/* Uses root variables from app.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
 


body {
    font-family: var(--font-primary);
    background-color: #fafafa;
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
}

.container {
    width: 92%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================
   DESKTOP GLOBAL STYLES & LAYOUT
========================================== */

.top-header {
    background: var(--white);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    width: 65px;
    height: 65px;
    object-fit: contain;
}

.tag h3 {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.1;
}

.tag p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
    font-weight: 400;
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 420px;
    border: 1px solid #f2e2e4;
    background-color: #fdf6f2;
    border-radius: var(--radius-lg);
    overflow: visible;
}

/* SEARCH WRAPPER & DROPDOWN */
.header-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.header-search-wrapper .search-box {
    max-width: 100%;
}

.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    max-height: 480px;
    overflow-y: auto;
    z-index: 10000;
}

.search-dropdown.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    border-bottom: 1px solid #f5f5f5;
}

.search-result-item:hover {
    background: #fdf6f2;
}

.search-result-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    flex-shrink: 0;
}

.search-result-item .result-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.search-result-item .result-info .result-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .result-info .result-tags {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.search-result-item .result-info .result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.search-result-item .result-info .result-details span {
    font-size: 11px;
    color: #777;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.search-result-item .result-info .result-details span i {
    font-size: 10px;
    color: var(--secondary);
}

.search-result-item .result-info .result-id {
    font-size: 11px;
    color: #aaa;
    margin-top: 1px;
}

.search-no-result {
    padding: 24px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-no-result i {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    color: #ddd;
}

.search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border-top: 2px solid #f0f0f0;
    transition: background 0.15s;
}

.search-view-all:hover {
    background: #fdf6f2;
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    padding: 10px 20px;
    font-size: 14px;
    background: transparent;
    color: var(--dark);
}

.search-box button {
    width: 50px;
    border: none;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.login-btn {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

.register-btn {
    background: var(--secondary);
    color: var(--white);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    box-shadow: 0 3px 6px rgba(244, 180, 0, 0.2);
    transition: var(--transition);
}

.register-btn:hover {
    background: var(--secondary-dark);
    transform: translateY(-1px);
}

.top-header .menu-btn,
.mobile-actions-row {
    display: none;
}

.navbar {
    background: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
}

.nav-links a {
    display: block;
    padding: 12px 24px;
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active-link {
    color: var(--secondary);
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 10px; 
}

.desktop-nav-icon {
    color: var(--white);
    font-size: 16px;
    cursor: pointer;
}

.desktop-nav-icon {
    display: none !important; 
}

/* ==========================================
   TABLET VIEW RESPONSIVE (768px to 1024px)
========================================== */
@media (max-width: 1024px) {
    .tag h3 { font-size: 20px; }
    .tag p { font-size: 12px; }
    .search-box { max-width: 320px; }
    .nav-links a { padding: 12px 16px; }
}


/* ==========================================
   PREMIUM MOBILE VIEW (767px and below)
========================================== */
@media (max-width: 767px) {
    
    .top-header {
        padding: 10px 0;
    }

    .header-grid {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .logo img {
        width: 48px;
        height: 48px;
    }

    .tag h3 {
        font-size: 16px;
    }

    .tag p {
        font-size: 10px;
    }

    .desktop-search, 
    .header-right,
    .desktop-nav-icon {
        display: none !important;
    }

    .top-header .menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 22px;
        color: var(--primary);
        cursor: pointer;
        padding: 5px;
    }

    .mobile-actions-row {
        display: block;
        background: var(--white);
        padding: 12px 0 16px 0; 
        margin: 0;
        border-bottom: 1px solid var(--border);
    }

    .mobile-flex-container {
        display: flex;
        align-items: center;     
        justify-content: space-between;  
        gap: 10px;
        width: 92%;
        margin: 0 auto;
    }

    .mobile-actions-row .search-box {
        display: flex !important;
        align-items: center;     
        flex: 1;
        max-width: 72%;        
        height: 42px;             
        border: 1px solid rgba(122, 15, 25, 0.18);
        border-radius: var(--radius-lg); 
        background-color: #fdf6f2; 
    }

    .mobile-actions-row .search-box input {
        height: 100%;            
        font-size: 13px;
        padding: 0 15px;
    }

    .mobile-login-premium {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 42px;            
        padding: 0 20px;         
        background: var(--primary);
        color: var(--white) !important;
        font-size: 14px;
        font-weight: 500;
        border-radius: var(--radius-lg);
        white-space: nowrap;
        box-shadow: 0 2px 6px rgba(122, 15, 25, 0.15);
    }

    .navbar {
        position: relative;
        background: transparent;
        box-shadow: none;
    }

    .navbar .container {
        padding: 0;
    }

    .nav-links {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
        z-index: 9999;
    }

    .nav-links.active {
        max-height: 300px;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #f9f9f9;
    }

    .nav-links a {
        padding: 14px 20px;
        color: var(--dark);
        font-weight: 500;
        font-size: 14px;
    }

    .nav-links a:hover,
    .nav-links a.active-link {
        color: var(--primary);
        background: var(--bg);
        border-bottom: none;
        padding-left: 25px; 
    }

    .mobile-toggle {
        width: 42px !important;
        height: 42px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }

    .mobile-toggle .user-name,
    .mobile-toggle .fa-chevron-down {
        display: none !important;
    }

    .mobile-dropdown {
        right: 0 !important;
        left: auto !important;
        min-width: 180px;
    }

    .mobile-search-wrapper {
        position: relative;
        flex: 1;
    }

    .mobile-search-wrapper .search-dropdown {
        left: 0;
        right: 0;
        max-height: 60vh;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    }

    .mobile-search-wrapper .search-result-item img {
        width: 40px;
        height: 40px;
    }

    .mobile-search-wrapper .search-result-item .result-details {
        flex-wrap: wrap;
        gap: 4px 8px;
    }
}

/* ============================================================
   USER MENU / PROFILE DROPDOWN
   ============================================================ */

.user-menu {
    position: relative;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.user-toggle:hover {
    background: rgba(192, 57, 43, 0.06);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar.small {
    width: 34px;
    height: 34px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar span {
    background: var(--primary);
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar.small span {
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-toggle .fa-chevron-down {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    min-width: 220px;
    z-index: 10000;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    font-size: 14px;
    color: var(--dark);
    text-decoration: none;
    transition: background 0.2s;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: #fdf6f2;
    color: var(--primary);
}

.user-dropdown a i,
.user-dropdown button i {
    width: 18px;
    text-align: center;
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}