/* ============================================
   CHOICHO - MAIN STYLESHEET
   Glassmorphism, Responsive, Dark Theme
   ============================================ */

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
  }
  
  .page {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #000;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }
  
  .scrollable-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    padding: 0 0 5.5rem 0;
    background: #000;
  }
  
  .scrollable-content::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  
  .scrollable-content {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .top-icons {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0.8rem 0.3rem 0.8rem;
    flex-shrink: 0;
    position: relative;
    background: #000;
    margin: 0 auto;
  }
  
  .corner-btn {
    width: 2.4rem;
    height: 2.4rem;
    background: #1a1a1a;
    border-radius: 50%;
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.3s;
  }
  
  .corner-btn:active {
    transform: scale(0.95);
  }
  
  .top-brand {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 3px;
    font-family: 'Segoe Script', 'Brush Script MT', 'Apple Chancery', 'Comic Sans MS', cursive;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    line-height: 1;
    font-style: italic;
  }
  
  .floating-nav {
    position: fixed;
    bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 500px;
    background: transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 2.5rem;
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 100;
    transition: all 0.3s ease;
  }
  
  .nav-center {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 380px;
    gap: 0.3rem;
  }
  
  .nav-center a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    transition: all 0.3s;
    text-decoration: none;
    background: transparent;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  }
  
  .nav-center a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
  }
  
  .nav-center a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.08);
  }
  
  .nav-upload, .nav-search {
    display: none !important;
  }
  
  @media (min-width: 1024px) {
    .top-icons {
      display: none;
    }
    .nav-upload, .nav-search {
      display: flex !important;
    }
    .floating-nav {
      position: fixed;
      top: 50%;
      left: 1.5rem;
      bottom: auto;
      transform: translateY(-50%);
      width: 3.8rem;
      height: auto;
      max-width: none;
      border-radius: 2.5rem;
      padding: 1rem 0.6rem;
      flex-direction: column;
    }
    .nav-center {
      flex-direction: column;
      gap: 1.2rem;
      max-width: none;
    }
    .nav-center a {
      font-size: 1.4rem;
      width: 2.6rem;
      height: 2.6rem;
    }
    .scrollable-content {
      padding: 0 0 1rem 5.5rem;
    }
  }
  
  @media (max-width: 380px) {
    .floating-nav {
      width: 94%;
      padding: 0.5rem 0.8rem;
    }
    .nav-center a {
      font-size: 1.1rem;
      width: 2rem;
      height: 2rem;
    }
  }
  
  .stories-bar {
    display: flex;
    gap: 0.8rem;
    padding: 0.3rem 0.8rem 0.5rem;
    overflow-x: auto;
    border-bottom: 1px solid #1a1a1a;
    background: #000;
  }
  
  .stories-bar::-webkit-scrollbar {
    height: 0;
  }
  
  .story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    flex-shrink: 0;
  }
  
  .story-ring {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .story-ring.friend {
    background: linear-gradient(45deg, #f59e0b, #ef4444, #e91e63);
  }
  
  .story-ring.bestie {
    background: linear-gradient(45deg, #8b5cf6, #ec4899, #f59e0b);
  }
  
  .story-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 2px solid #000;
    color: #fff;
    overflow: hidden;
  }
  
  .story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .story-name {
    font-size: 0.6rem;
    color: #999;
    max-width: 65px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .feed-card {
    width: 100%;
    background: #000;
    border-bottom: 1px solid #1a1a1a;
    margin-bottom: 1rem;
  }
  
  .feed-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
  }
  
  .feed-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
  }
  
  .feed-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .feed-username {
    font-size: 0.8rem;
    font-weight: 600;
    color: #3897f0;
    cursor: pointer;
  }
  
  .feed-time {
    font-size: 0.6rem;
    color: #888;
    margin-left: auto;
  }
  
  .feed-image-container {
    width: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .feed-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    display: block;
  }
  
  .feed-actions {
    display: flex;
    gap: 1.2rem;
    padding: 0.6rem 0.8rem;
  }
  
  .feed-action {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .feed-action:active {
    transform: scale(1.2);
  }
  
  .feed-action.liked {
    color: #ef4444;
  }
  
  .feed-likes {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0 0.8rem;
    margin-bottom: 0.2rem;
  }
  
  .feed-caption {
    padding: 0 0.8rem 0.3rem;
    font-size: 0.75rem;
    word-break: break-word;
  }
  
  .feed-caption span {
    font-weight: 600;
    color: #3897f0;
    cursor: pointer;
    margin-right: 0.3rem;
  }
  
  .view-comments-btn {
    padding: 0 0.8rem 0.5rem;
    font-size: 0.65rem;
    color: #888;
    cursor: pointer;
  }
  
  .toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    z-index: 800;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    white-space: nowrap;
  }
  
  .toast.show {
    opacity: 1;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
/* ============================================
   SEARCH BAR - RESPONSIVE PURE CSS
   ============================================ */

/* Search Container */
.search-container {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.8rem;
    margin: 0 auto;
    position: relative;
    background: transparent;
}

/* Search Wrapper */
.search-wrapper {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border-radius: 2rem;
    border: 1px solid #333;
    transition: all 0.3s ease;
    padding: 0.3rem 0.3rem 0.3rem 1rem;
    gap: 0.3rem;
}

.search-wrapper:focus-within {
    border-color: #3897f0;
    box-shadow: 0 0 20px rgba(56, 151, 240, 0.15);
    background: #222;
}

/* Search Icon */
.search-icon {
    color: #666;
    font-size: 1rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-right: 0.3rem;
}

/* Search Input */
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.9rem;
    padding: 0.6rem 0;
    min-width: 0;
    width: 100%;
}

.search-input::placeholder {
    color: #666;
    font-size: 0.85rem;
}

/* Clear Button */
.search-clear {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    font-size: 1rem;
    display: none;
    flex-shrink: 0;
    transition: color 0.2s;
}

.search-clear:hover {
    color: #fff;
}

.search-clear.visible {
    display: block;
}

/* Search Submit Button */
.search-submit {
    background: linear-gradient(45deg, #3897f0, #5851db);
    border: none;
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    white-space: nowrap;
}

.search-submit:active {
    transform: scale(0.95);
}

.search-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Extra Small Mobile (<= 380px) */
@media (max-width: 380px) {
    .search-container {
        padding: 0.3rem 0.5rem;
        max-width: 100%;
    }
    
    .search-wrapper {
        padding: 0.2rem 0.2rem 0.2rem 0.6rem;
        border-radius: 1.8rem;
        gap: 0.2rem;
    }
    
    .search-input {
        font-size: 0.75rem;
        padding: 0.4rem 0;
    }
    
    .search-input::placeholder {
        font-size: 0.7rem;
    }
    
    .search-icon {
        font-size: 0.8rem;
        padding-right: 0.2rem;
    }
    
    .search-submit {
        padding: 0.3rem 0.7rem;
        font-size: 0.7rem;
        border-radius: 1.5rem;
    }
    
    .search-clear {
        font-size: 0.8rem;
        padding: 0.2rem 0.3rem;
    }
}

/* Small Mobile (381px - 480px) */
@media (min-width: 381px) and (max-width: 480px) {
    .search-container {
        padding: 0.4rem 0.6rem;
        max-width: 100%;
    }
    
    .search-wrapper {
        padding: 0.25rem 0.25rem 0.25rem 0.8rem;
        gap: 0.25rem;
    }
    
    .search-input {
        font-size: 0.8rem;
        padding: 0.5rem 0;
    }
    
    .search-input::placeholder {
        font-size: 0.75rem;
    }
    
    .search-submit {
        padding: 0.35rem 0.9rem;
        font-size: 0.75rem;
    }
}

/* Medium Mobile (481px - 600px) */
@media (min-width: 481px) and (max-width: 600px) {
    .search-container {
        padding: 0.5rem 0.8rem;
        max-width: 100%;
    }
    
    .search-wrapper {
        padding: 0.3rem 0.3rem 0.3rem 1rem;
        border-radius: 2.2rem;
    }
    
    .search-input {
        font-size: 0.85rem;
        padding: 0.55rem 0;
    }
    
    .search-input::placeholder {
        font-size: 0.8rem;
    }
    
    .search-submit {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
    
    .search-icon {
        font-size: 0.9rem;
    }
}

/* Tablet (601px - 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
    .search-container {
        max-width: 600px;
        padding: 0.6rem 1rem;
    }
    
    .search-wrapper {
        padding: 0.4rem 0.4rem 0.4rem 1.2rem;
        border-radius: 2.5rem;
        gap: 0.4rem;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 0.7rem 0;
    }
    
    .search-input::placeholder {
        font-size: 0.95rem;
    }
    
    .search-icon {
        font-size: 1.1rem;
    }
    
    .search-submit {
        padding: 0.5rem 1.4rem;
        font-size: 0.9rem;
        border-radius: 2.5rem;
    }
}

/* Desktop (1025px - 1399px) */
@media (min-width: 1025px) and (max-width: 1399px) {
    .search-container {
        max-width: 700px;
        padding: 0.7rem 1.2rem;
    }
    
    .search-wrapper {
        padding: 0.45rem 0.45rem 0.45rem 1.5rem;
        border-radius: 3rem;
        gap: 0.5rem;
    }
    
    .search-input {
        font-size: 1.05rem;
        padding: 0.75rem 0;
    }
    
    .search-input::placeholder {
        font-size: 1rem;
    }
    
    .search-icon {
        font-size: 1.2rem;
    }
    
    .search-submit {
        padding: 0.6rem 1.8rem;
        font-size: 0.95rem;
        border-radius: 3rem;
    }
    
    .search-wrapper:hover {
        border-color: #555;
    }
}

/* Large Desktop (>= 1400px) */
@media (min-width: 1400px) {
    .search-container {
        max-width: 800px;
        padding: 0.8rem 1.5rem;
    }
    
    .search-wrapper {
        padding: 0.5rem 0.5rem 0.5rem 1.8rem;
        border-radius: 3.5rem;
        gap: 0.6rem;
    }
    
    .search-input {
        font-size: 1.15rem;
        padding: 0.85rem 0;
    }
    
    .search-input::placeholder {
        font-size: 1.05rem;
    }
    
    .search-icon {
        font-size: 1.3rem;
    }
    
    .search-submit {
        padding: 0.7rem 2.2rem;
        font-size: 1.05rem;
        border-radius: 3.5rem;
    }
}

/* ============================================
   SEARCH BAR VARIANTS
   ============================================ */

/* Compact Search (For Navbar) */
.search-compact .search-wrapper {
    padding: 0.2rem 0.2rem 0.2rem 0.8rem;
    border-radius: 1.5rem;
}

.search-compact .search-input {
    font-size: 0.75rem;
    padding: 0.35rem 0;
}

.search-compact .search-submit {
    padding: 0.25rem 0.7rem;
    font-size: 0.65rem;
}

.search-compact .search-icon {
    font-size: 0.75rem;
}

/* Full Width Search */
.search-full {
    max-width: 100% !important;
    padding: 0.5rem 0 !important;
}

.search-full .search-wrapper {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 0.5rem 1rem;
}

/* No Border Search */
.search-noborder .search-wrapper {
    border: none;
    background: rgba(255, 255, 255, 0.05);
}

.search-noborder .search-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

/* ============================================
   SEARCH EXPANDED (Full Screen Mobile)
   ============================================ */

.search-expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    display: none;
    padding: 1.5rem 1rem;
    flex-direction: column;
}

.search-expanded.active {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

.search-expanded .search-container {
    max-width: 100%;
    padding: 0;
}

.search-expanded .search-wrapper {
    padding: 0.8rem 0.8rem 0.8rem 1.5rem;
    border-radius: 2.5rem;
    background: #1a1a1a;
}

.search-expanded .search-input {
    font-size: 1.2rem;
    padding: 0.8rem 0;
}

.search-expanded .search-submit {
    padding: 0.7rem 1.8rem;
    font-size: 1rem;
}

.search-expanded .close-search {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #1a1a1a;
    border: none;
    color: #fff;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
    transition: all 0.3s;
}

.search-expanded .close-search:active {
    transform: scale(0.9);
}

/* Search Results */
.search-results {
    margin-top: 1.5rem;
    display: none;
    overflow-y: auto;
    flex: 1;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 0.5rem;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #333;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.search-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
}

.search-result-username {
    font-size: 0.75rem;
    color: #888;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.search-loading .search-submit {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   DARK THEME SPECIFIC
   ============================================ */

/* Scrollbar Styling */
.search-results::-webkit-scrollbar {
    width: 3px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

/* Focus States */
.search-input:focus::placeholder {
    opacity: 0.5;
}

/* Disabled State */
.search-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.w-full {
    width: 100%;
}
