/* ==================== APP LAYOUT ==================== */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-dark);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-section);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    z-index: var(--z-fixed);
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.sidebar-logo svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
    transition: filter var(--transition-normal);
}

.sidebar-logo:hover svg {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.sidebar-logo-text {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-gray);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    color: var(--text-white);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--text-white);
    background: var(--bg-hover);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--fitness-teal);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item-icon svg {
    width: 100%;
    height: 100%;
}

.nav-item-text {
    font-size: var(--text-sm);
    font-weight: 500;
}

.nav-item-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--soulmate-red);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Platform Nav Items */
.nav-item[data-platform="soulmate"]:hover,
.nav-item[data-platform="soulmate"].active {
    color: var(--soulmate-red);
}
.nav-item[data-platform="soulmate"].active::before {
    background: var(--soulmate-red);
}

.nav-item[data-platform="creator"]:hover,
.nav-item[data-platform="creator"].active {
    color: var(--creator-orange);
}
.nav-item[data-platform="creator"].active::before {
    background: var(--creator-orange);
}

.nav-item[data-platform="ai"]:hover,
.nav-item[data-platform="ai"].active {
    color: var(--ai-gold);
}
.nav-item[data-platform="ai"].active::before {
    background: var(--ai-gold);
}

.nav-item[data-platform="professional"]:hover,
.nav-item[data-platform="professional"].active {
    color: var(--professional-yellow);
}
.nav-item[data-platform="professional"].active::before {
    background: var(--professional-yellow);
}

.nav-item[data-platform="fitness"]:hover,
.nav-item[data-platform="fitness"].active {
    color: var(--fitness-teal);
}
.nav-item[data-platform="fitness"].active::before {
    background: var(--fitness-teal);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-default);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--bg-hover);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-input);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-username {
    font-size: var(--text-xs);
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-menu {
    color: var(--text-dim);
    transition: color var(--transition-fast);
}

.sidebar-user:hover .sidebar-user-menu {
    color: var(--text-white);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content.with-right-sidebar {
    margin-right: 320px;
}

/* ==================== TOP HEADER ==================== */
.top-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-default);
    padding: var(--space-md) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.top-header-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-white);
}

.top-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Search Bar */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-bar-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    padding-left: 2.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-white);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.search-bar-input:hover {
    border-color: var(--border-hover);
}

.search-bar-input:focus {
    outline: none;
    border-color: var(--fitness-teal);
    box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.15);
}

.search-bar-input::placeholder {
    color: var(--text-dim);
}

.search-bar-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.search-bar-icon svg {
    width: 18px;
    height: 18px;
}

/* Header Icon Buttons */
.header-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.header-icon-btn svg {
    width: 22px;
    height: 22px;
}

/* Gold TTS and Voice Toggle Buttons */
.header-icon-btn#ttsToggle,
.header-icon-btn#voiceToggle,
.header-icon-btn.voice-toggle {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #FFD700;
    color: #FFD700;
}

.header-icon-btn#ttsToggle:hover,
.header-icon-btn#voiceToggle:hover,
.header-icon-btn.voice-toggle:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
}

.header-icon-btn#ttsToggle svg,
.header-icon-btn#voiceToggle svg,
.header-icon-btn.voice-toggle svg {
    fill: #FFD700 !important;
}

.header-icon-btn#ttsToggle svg path,
.header-icon-btn#ttsToggle svg polygon,
.header-icon-btn#voiceToggle svg path,
.header-icon-btn#voiceToggle svg polygon,
.header-icon-btn.voice-toggle svg path,
.header-icon-btn.voice-toggle svg polygon {
    fill: #FFD700 !important;
    stroke: #FFD700;
}

.header-icon-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--soulmate-red);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-dark);
}

/* ==================== RIGHT SIDEBAR ==================== */
.right-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    background: var(--bg-section);
    border-left: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    z-index: var(--z-fixed);
    overflow-y: auto;
}

.right-sidebar-section {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.right-sidebar-title {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: var(--space-md);
}

/* Trending Section */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.trending-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.trending-item:hover {
    background: var(--bg-hover);
}

.trending-rank {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-dim);
    min-width: 24px;
}

.trending-content {
    flex: 1;
}

.trending-hashtag {
    font-weight: 600;
    color: var(--text-white);
    font-size: var(--text-sm);
}

.trending-count {
    font-size: var(--text-xs);
    color: var(--text-dim);
}

/* Suggestions Section */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.suggestion-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-input);
}

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

.suggestion-name {
    font-weight: 600;
    color: var(--text-white);
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-username {
    font-size: var(--text-xs);
    color: var(--text-dim);
}

.suggestion-follow-btn {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid var(--fitness-teal);
    border-radius: var(--radius-full);
    color: var(--fitness-teal);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.suggestion-follow-btn:hover {
    background: var(--fitness-teal);
    color: var(--text-white);
}

/* ==================== MOBILE MENU ==================== */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-white);
    cursor: pointer;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: calc(var(--z-fixed) - 1);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1280px) {
    .right-sidebar {
        display: none;
    }

    .main-content.with-right-sidebar {
        margin-right: 0;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-overlay.active {
        display: block;
    }

    .top-header {
        padding: var(--space-sm) var(--space-md);
    }

    .top-header-actions {
        gap: var(--space-xs);
    }
}

@media (max-width: 768px) {
    .top-header {
        flex-wrap: nowrap;
        gap: var(--space-sm);
    }

    .top-header-title {
        flex: 1;
        min-width: 0;
        font-size: var(--text-base);
    }

    .top-header-actions {
        flex-shrink: 0;
    }

    /* Ensure TTS/Mic buttons are always visible */
    .top-header-actions #ttsToggle,
    .top-header-actions #voiceToggle {
        display: inline-flex !important;
        flex-shrink: 0;
    }

    /* Hide less important actions on mobile */
    .top-header-actions .btn:not(#ttsToggle):not(#voiceToggle) {
        display: none;
    }

    .top-header-actions .header-icon-btn {
        display: none;
    }
}

@media (max-width: 640px) {
    .top-header {
        padding: var(--space-xs) var(--space-sm);
    }

    .search-bar {
        display: none;
    }

    .top-header-title {
        font-size: var(--text-sm);
    }
}

@media (max-width: 480px) {
    .mobile-menu-btn {
        width: 36px;
        height: 36px;
    }

    .top-header-actions {
        gap: 2px;
    }

    #ttsToggle, #voiceToggle {
        width: 32px !important;
        height: 32px !important;
    }
}

@media (max-width: 375px) {
    .top-header {
        padding: var(--space-xs);
    }

    .top-header-title {
        font-size: 0.8rem;
    }

    #ttsToggle, #voiceToggle {
        width: 30px !important;
        height: 30px !important;
    }

    #ttsToggle svg, #voiceToggle svg {
        width: 14px !important;
        height: 14px !important;
    }
}
