
          :root {
            --primary-color: #3897f0;
            --secondary-color: #fafafa;
            --border-color: #dbdbdb;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--secondary-color);
            margin: 0;
            padding: 0;
            color: #262626;
        }
        
    
    canvas {
  image-rendering: crisp-edges; /* For pixel art */
  image-rendering: -webkit-optimize-contrast; /* Safari fix */
  transform: translateZ(0); /* Force GPU rendering */
}    
        
        .header {
            border-bottom: 1px solid var(--border-color);
            background: white;
            position: fixed;
            top: 0;
            width: 100%;
            z-index: 1001;
            transition:300ms ease-in;
        }
        .header-content {
            max-width: 975px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
        }
        .logo {
            
            font-size: 16px;
            font-weight: bold;
        }
        
        #cem{
            font-size:12px; top:0px; left:105px; font-weight:bold; color:dodgerblue; position:absolute; width:250px; margin-top:-10px;
        }
        
        
        .search {
            background: var(--secondary-color);
            border: 1px solid var(--border-color);
            border-radius: 3px;
            padding: 5px 10px;
            width: 215px;
        }
        
  #search_bar{
margin-bottom:10px;
margin-left:20px;
    
}  

#toggle_search, #toggle_search_mob{cursor:pointer}


.following-link{color:white; text-decoration:none; background-color:dodgerblue; border-radius:3px; margin-left:10px; padding:5px}

#search_form{display:none;}
        
        
        
        .nav-icons {
            display: flex;
            gap: 22px;
            align-items: center;
        }
        .nav-icons a {
            color: #262626;
    text-decoration: none;
    font-size: 22px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
        }
        
        .nav-icons a:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.nav-icons a i {
    display: block;
}

.nav-icons a.active {
    color: royalblue;
}



        .main {
            max-width: 935px;
            margin: 80px auto 30px;
            display: flex;
        }
        .feed {
            width: 100%;
            max-width: 614px;
        }
        .stories {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 3px;
            padding: 16px;
            margin-bottom: 24px;
            display: flex;
            overflow-x: auto;
            gap: 15px;
            position:relative;
        
        }
        
        #main_story{
            text-align:center; width:100%;
        }
        
        .story {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 66px;
            
        }
        .story-avatar {
            width: 56px;
            height: 56px;
            /*border-radius: 50%;*/
            /*padding: 2px;
            background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);*/
        }
        .story-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 2px solid white;
            object-fit: cover;
        }
        .story-username {
            font-size: 12px;
            margin-top: 5px;
            text-overflow: ellipsis;
            max-width: 100%;
            overflow: hidden;
            white-space: nowrap;
        }
        .post {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 3px;
            margin-bottom: 24px;
            position:relative;
        }
        .post-header {
            display: flex;
            align-items: center;
            padding: 14px 16px;
        }
        .post-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            margin-right: 12px;
        }
        .post-username {
            font-weight: 600;
        }
        .post-image {
            width: 100%;
            /*max-height: 767px;*/
            object-fit: cover;    
            transition: transform 0.3s ease;
    transform-origin: center top;
    will-change: transform; /* Improves animation performance */
    cursor:grab;
        }
        

        
        .post-actions {
            padding: 6px 16px;
            padding-top:27px;
            display: flex;
            gap: 16px;
        }
        .post-action {
            font-size: 24px;
            cursor: pointer;
        }
        .post-likes {
            font-weight: 600;
            padding: 0 16px;
            margin-bottom: 8px;
        }
        .post-caption {
            padding: 0 16px;
            
            max-height:100px; overflow-y:auto; margin-bottom:20px; 
        }
        .post-caption-username {
            font-weight: 600;
            margin-right: 5px;
            color:white; text-decoration:none; background-color:#95a5a6;  padding:5px; border-radius:3px; 
        }
        
        
        
        .post-time {
            color: #8e8e8e;
            font-size: 10px;
            text-transform: uppercase;
            padding: 0 16px 12px;
            letter-spacing: 0.2px;
        }
        .sidebar {
            width: 293px;
            margin-left: 28px;
            position: sticky;
            top: 90px;
            height: fit-content;
        }
        .user-card {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }
        .user-card-avatar {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            margin-right: 16px;
        }
        .user-card-info {
            flex: 1;
        }
        .user-card-username {
            font-weight: 600;
        }
        .user-card-name {
            color: #8e8e8e;
        }
        .suggestions {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 3px;
            padding: 16px;
        }
        .suggestions-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 16px;
        }
        .suggestions-title {
            color: #8e8e8e;
            font-weight: 600;
        }
        .suggestion {
            display: flex;
            align-items: center;
            margin-bottom: 16px;
        }
        .suggestion-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            margin-right: 12px;
        }
        .suggestion-info {
            flex: 1;
        }
        .suggestion-username {
            font-weight: 600;
            font-size: 14px;
        }
        .suggestion-follow {
            color: var(--primary-color);
            font-weight: 600;
            font-size: 12px;
            cursor: pointer;
        }
        .footer {
            text-align: center;
            color: #8e8e8e;
            font-size: 12px;
            margin-top: 30px;
        }
        
        /* Floating upload button styles */
    .upload-float {
        position: fixed;
        right: 20px;
        bottom: 20px;
        z-index: 1000;
        display:none;
    }
    
    .upload-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        color: white;
        transition: transform 0.2s;
    }
    
    .upload-button:hover {
        transform: scale(1.1);
        color: white;
    }
    
    .upload-button svg {
        width: 24px;
        height: 24px;
    }
    
    
      #frame_control{position:fixed; bottom:2px; width:100%;  max-width:614px; transition:bottom 500ms; height:50px; -webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:0;}
    #left_btn{position:absolute; left:0px; width:calc(50% - 80px); height:45px;color:rgba(255,255,255,0.3); text-align:center; font-size:40px; line-height:40px; font-weight:bold;}
    #right_btn{position:absolute; right:0px; width:calc(50% - 80px); height:45px;color:rgba(255,255,255,0.3); text-align:center; font-size:40px; line-height:40px; font-weight:bold;}
    #frames_btn{position:absolute; left:calc(50% - 75px); width:70px; height:45px; color:rgba(255,255,255,0.3); text-align:center; font-size:35px; font-weight:bold; transition: 500ms; -webkit-text-stroke:2px rgba(0,0,0,0.2); text-stroke:2px rgba(0,0,0,0.2);   }
    #play_btn{position:absolute; left:calc(50% + 2px); width:70px; height:45px; color:rgba(255,255,255,0.3); text-align:center; font-size:40px; line-height:40px; font-weight:bold; transition: 500ms; -webkit-text-stroke:2px rgba(0,0,0,0.2); text-stroke:2px rgba(0,0,0,0.2);   }
    
    .control_btn{background-image: linear-gradient(to right, rgba(255,255,255,0.2), rgba(0,0,0,0));border:1px solid rgba(255,255,255,0.2); border-radius:7px; outline : 1px solid rgba(0,0,0,0.2);}    
    
    
 @media (max-width: 566px) {  
     
     #cem{left:105px; font-size:10px; width:200px; margin-top:-7px;}
     .logo > img{transform-origin:0 0;
         transform:scale(0.9);
        
         
     }
     

     
     .logo > a{transform-origin:0 0;
         transform:scale(0.9);
         
     }
     
      .logo > span {font-size:14px; text-align:left; margin-left:0px;
         
     }
     
     #homepagetitle{margin-left:0px;}
 } 

@media (max-width: 768px) {
    
    #frame_control{bottom:58px;}
    
    
    /* Adjust header for mobile */
    .header-content {
        padding: 10px;
    }
    
    .search {
        width:100%;
    }
    
    .nav-icons {
        gap: 15px;
    }
    
    /* Main layout adjustments */
    .main {
        flex-direction: column;
        margin: 60px 0 0 0;
        padding: 0;
        max-width: 100%;
    }
    
    .feed {
        max-width: 100%;
        padding: 0;
    }
    
    .stories {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 10px;
    }
    
    /* Post adjustments */
    .post {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 10px;
    }
    
    /* Hide sidebar on mobile */
    .sidebar {
        display: none;
    }
    
    /* Make action buttons larger for touch */
    .post-action {
        font-size: 28px;
    }
    
    /* Adjust floating upload button */
    .upload-float {
        right: 15px;
        bottom: 15px;
    }
    
    .upload-button {
        width: 50px;
        height: 50px;
    }
    
    
    #search_btn{
    position:relative;
    margin-left:43vw;
    text-align:center;
    margin-top:10px;
    margin-bottom:10px;
    
}

#search_bar{
margin-bottom:0px;
margin-left:0px;
} 
}

/* For very small screens */
@media (max-width: 480px) {
    .header-content {
        padding: 8px 10px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .nav-icons a {
        font-size: 20px;
    }
    
    .post-header,
    .post-actions,
    .post-likes,
    .post-caption,
    .post-time {
        padding-left: 12px;
        padding-right: 12px;
    }
}   
    
.mobile-nav-item span {
    font-size: 10px;
    font-weight: 500;
}
.mobile-nav-item.active {
    color: var(--primary-color);
}
.post-action, .mobile-nav-item, .upload-button {
    transition: transform 0.1s ease, opacity 0.1s ease;
}

.post-action:active, .mobile-nav-item:active, .upload-button:active {
    transform: scale(0.95);
    opacity: 0.8;
}    

/* Mobile bottom navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    display: none;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 1000;
    transition:300ms ease-in;
}

.mobile-nav-item {
    font-size: 22px;
    color: #262626;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    padding: 4px 12px;
    border-radius: 8px;
}
.mobile-nav-item i {
    margin-bottom: 4px;
}
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Hide desktop nav icons */
    .nav-icons {
        display: none;
    }
    
    /* Adjust main content to account for bottom nav */
    .main {
        margin-bottom: 70px;
    }
    
       /* Make header sticky instead of fixed */
    .header {
        position: sticky;
        top: 0;
    }
}



canvas.post-image {
    background-color: #000; /* Black background for letterboxing */
    display: block;
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: contain;
}

.post-image-container {
    position: relative;
    background: #000; /* Fallback background */
}

/* For mobile responsiveness */
@media (max-width: 768px) {
    canvas.post-image {
        /*max-height: 80vh;  Adjust based on your needs */
    }
}


.like-btn {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 24px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.like-btn:hover {
    transform: scale(1.1);
}

.like-btn:active {
    transform: scale(0.9);
}

.like-btn.liked {
    color: #ff0000; /* Red color for liked state */
}

.post-likes {
    font-weight: 600;
    margin: 5px 0;
    transition: all 0.3s ease;
}


.post-views {
    font-size: 14px;
    color: #8e8e8e;
    padding: 0 16px;
    margin-bottom: 8px;
}

.ive-views-count {
    font-weight: 500;
}

/* Share button styles */
.share-btn, .embed-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.3s;
    position:absolute;
    right:20px;
    bottom:5px;
}

.embed-btn {

    right:120px;
 
}

.share-btn i, .embed-btn i {
    margin-right: 5px;
}

/* Shared post login prompt */
.shared-post-login-prompt {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    background: #fafafa;
    border-radius: 8px;
}

.auth-buttons, .auth-buttons-2 {
    margin-top: 15px;
}

@media (max-width: 748px) {
   .auth-buttons {
    display: none;
}
}


.auth-btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

.login-btn {
    background: #3897f0;
    color: white;
}

.register-btn {
    background: #f0f0f0;
    color: #3897f0;
}

   .btn {
            padding: 8px 16px;
            border-radius: 4px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.2s ease;
        }
        .btn-primary {
            background-color: var(--primary-color);
            color: white;
            border: 1px solid var(--primary-color);
        }
        .btn-outline {
            background-color: transparent;
            color: var(--primary-color);
            border: 1px solid var(--border-color);
        }
        .btn:hover {
            opacity: 0.9;
            transform: scale(1.02);
        }
    
#manage_posts{
    background-color:dodgerblue;
    padding:10px;
    color:white;
    display:block;
    text-decoration:none;
    position:absolute;
    right:10px;
    border-radius:5px;
}    
    
 #puppet_posts{
    background-color:lightgray;
    padding:8px;
    color:white;
    display:block;
    text-decoration:none;
    position:absolute;
    right:10px;
    top:60px;
    border-radius:5px;
}     
    
    
 .pagination > a{
     text-decoration:none;
 } 
 
  .pagination > a.active{
      font-weight:bold; color:green; font-size:25px;
  }
  
  
#frame_progress{width:0%; position:relative; height:2px; background-color:dodgerblue;margin-top:-5px;}  
  