/* --- Beautified and updated common.css (updated for better mobile auth buttons & tooltips) --- */

:root {
    --light-bg: #f8f9fa;
    --light-text: #333;
    --light-primary: #2c3e50;
    --light-secondary: #7f8c8d;
    --light-container-bg: white;
    --light-highlight: #3498db;
    --dark-bg: #18191a;
    --dark-text: #e4e6eb;
    --dark-primary: #4599ff;
    --dark-secondary: #b0b3b8;
    --dark-container-bg: #242526;
    --dark-highlight: #80bdff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--light-text);
    margin: 0;
    padding: 0;
    transition: background-color .3s, color .3s;
}

.nav-brand-text,
.nav-links li a.active,
.site-footer a {
    font-weight: 700;
}

.navbar {
    background-color: var(--light-primary);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    transition: background-color .3s;
    gap: 20px;
}

.nav-left,
.nav-links {
    gap: 25px;
    display: flex;
    align-items: center;
}

.nav-left {
    flex-shrink: 0;
}

.nav-brand a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    height: 32px;
    width: auto;
    transition: height .3s;
}

.nav-brand-text {
    font-size: 1.5rem;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.nav-links li a {
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    font-size: 1rem;
    padding: 5px 10px 8px;
    font-weight: 500;
    background-color: transparent;
    transition: color .3s, text-shadow .3s;
    position: relative;
    display: block;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--light-highlight);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .3s ease-out;
}

.nav-links li a:focus {
    outline: 2px solid var(--light-highlight);
    outline-offset: 2px;
}

.nav-links li a.active,
.nav-links li a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(0, 71, 171, .5);
}

.nav-links li a.active::after,
.nav-links li a:hover::after {
    transform: scaleX(1);
}

/* Dropdown – Desktop */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--light-primary);
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
    border-radius: 6px;
    overflow: hidden;
    z-index: 1002;
    margin-top: 4px;
    padding: 6px 0;
}

.nav-dropdown li a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    font-size: 0.95rem;
    transition: background 0.15s;
}

.nav-dropdown li a:hover,
.nav-dropdown li a:focus {
    background-color: rgba(255,255,255,0.15);
    color: white;
    outline: 2px solid var(--light-highlight);
    outline-offset: -2px;
}

.dropdown-trigger.open .nav-dropdown {
    display: block;
}

.dropdown-trigger.open > a::after {
    content: " ▲";
}

/* ── Auth / Login / Signup / User Menu ────────────────────────────────────── */

.auth-links {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-login {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s;
    border-radius: 30px;
    white-space: nowrap;
}

.nav-login:hover,
.nav-login:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-signup {
    background-color: var(--light-highlight);
    color: white !important;
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(52,152,219,0.3);
    transition: all 0.2s;
    white-space: nowrap;
    border: 2px solid transparent;
}

.nav-signup:hover,
.nav-signup:focus {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52,152,219,0.4);
}

/* Logged-in user avatar style */
.user-avatar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    transition: background-color 0.2s;
}

.user-avatar-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
}

.user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown {
    right: 0;
    left: auto;
    min-width: 180px;
}

/* ── Custom Beautiful Tooltips ────────────────────────────────────────────── */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.18s ease;
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    min-width: max-content;
}

[data-tooltip]::after {
    content: "";
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: inherit;
    border-bottom: 0;
}

/* Light mode tooltip */
[data-tooltip]::before {
    background: #2c3e50;
    color: white;
}

[data-tooltip]::after {
    border-top-color: #2c3e50;
}

/* Dark mode tooltip */
body.dark-mode [data-tooltip]::before {
    background: #e4e6eb;
    color: #18191a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

body.dark-mode [data-tooltip]::after {
    border-top-color: #e4e6eb;
}

/* ── MOBILE & TABLET SIDEBAR ──────────────────────────────────────────────── */
@media (max-width: 1199px) {
    .navbar {
        padding: 12px 20px;
        justify-content: space-between;
    }

    .hamburger-menu {
        display: flex !important;
        position: relative;
        z-index: 2000;
        background: transparent;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        left: auto;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        background-color: var(--light-primary);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1999;
        padding: 80px 0 30px;
        gap: 0;
        overflow-y: auto;
        margin: 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
    }

    .nav-links li a {
        display: block;
        padding: 16px 25px;
        font-size: 1.1rem;
        color: rgba(255, 255, 255, 0.9);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links li a::after {
        display: none;
    }

    /* Dropdown in mobile */
    .nav-dropdown {
        position: static;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.2);
        margin: 0;
        border-radius: 0;
        display: none;
    }
    
    .dropdown-trigger.open .nav-dropdown {
        display: block;
    }
    
    .nav-dropdown li a {
        padding-left: 40px !important;
        font-size: 1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* ── Mobile Auth Buttons – BIG, BOLD, CENTERED ───────────────── */
    .auth-links {
        margin-top: auto;
        flex-direction: column;
        gap: 15px;
        width: 100%;
        padding: 30px 25px 40px;
        border-top: 2px solid rgba(255,255,255,0.15);
        background: rgba(0, 0, 0, 0.1);
    }

    .nav-login,
    .nav-signup {
        display: block;
        width: 100%;
        text-align: center;
        font-size: 1.2rem;
        font-weight: 700;
        padding: 14px 20px;
        border-radius: 50px;
        box-sizing: border-box;
        transition: all 0.2s ease;
    }

    .nav-login {
        background: rgba(255, 255, 255, 0.15);
        color: white;
        border: 2px solid rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(5px);
    }

    .nav-login:hover,
    .nav-login:active {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.5);
        transform: scale(1.02);
    }

    .nav-signup {
        background: linear-gradient(135deg, #3498db, #2980b9);
        color: white;
        border: 2px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
        font-weight: 800;
        letter-spacing: 0.5px;
    }

    .nav-signup:hover,
    .nav-signup:active {
        background: linear-gradient(135deg, #3fa3e5, #2c8ac9);
        box-shadow: 0 10px 25px rgba(52, 152, 219, 0.6);
        transform: translateY(-2px) scale(1.02);
    }

    /* Dark mode mobile styles */
    body.dark-mode .nav-links {
        background-color: var(--dark-container-bg);
    }

    body.dark-mode .nav-login {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #f0f4ff;
    }

    body.dark-mode .nav-login:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(255, 255, 255, 0.35);
    }

    body.dark-mode .nav-signup {
        background: linear-gradient(135deg, #4599ff, #2d7ae0);
        box-shadow: 0 8px 20px rgba(69, 153, 255, 0.35);
    }

    body.dark-mode .nav-signup:hover {
        background: linear-gradient(135deg, #55a5ff, #3d8aef);
        box-shadow: 0 12px 28px rgba(69, 153, 255, 0.5);
    }

    /* User menu in mobile */
    .user-menu {
        width: 100%;
    }
    
    .user-avatar-link {
        padding: 12px 25px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 0;
        justify-content: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .user-dropdown {
        width: 100%;
        position: static;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.2);
    }
}

/* ── DESKTOP full horizontal menu ─────────────────────────────────────────── */
@media (min-width: 1200px) {
    .hamburger-menu {
        display: none !important;
    }

    .nav-logo {
        height: 40px;
    }

    .nav-links {
        position: static;
        right: auto;
        width: auto;
        height: auto;
        flex-direction: row;
        justify-content: flex-end;
        background: none;
        box-shadow: none;
        padding-top: 0;
        overflow: visible;
        gap: 8px;
        flex-wrap: nowrap;
        margin-left: auto;
        margin-right: 0;
        align-items: center;
    }

    .nav-links li {
        width: auto;
        margin: 0 2px;
    }

    .nav-links li a {
        font-size: 0.95rem;
        padding: 8px 14px;
        white-space: nowrap;
        border-radius: 30px;
    }

    .nav-links li a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .nav-links li a::after {
        bottom: 4px;
        width: calc(100% - 28px);
        left: 14px;
    }

    /* Auth links in desktop */
    .auth-links {
        margin-left: 10px;
        gap: 8px;
    }

    .nav-login {
        padding: 8px 16px;
        border-radius: 30px;
    }

    .nav-signup {
        padding: 8px 20px;
        border-radius: 30px;
        margin-left: 5px;
    }

    /* User menu in desktop */
    .user-avatar-link {
        padding: 5px 15px 5px 10px;
    }

    /* Adjust for smaller desktop screens */
    @media (min-width: 1200px) and (max-width: 1400px) {
        .nav-links {
            gap: 4px;
        }
        .nav-links li a {
            font-size: 0.9rem;
            padding: 7px 10px;
        }
        .nav-links li a::after {
            width: calc(100% - 20px);
            left: 10px;
        }
        .auth-links {
            gap: 5px;
        }
        .nav-signup {
            padding: 7px 16px;
        }
    }
}

/* Hide brand text on small phones */
@media (max-width: 480px) {
    .nav-brand-text {
        display: none;
    }
    
    .nav-links {
        width: 90%;
        max-width: 300px;
    }
}

/* Theme Switch & Footer */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    right: 0;
    top: 0;
    border-radius: 24px;
}

.slider,
.slider:before {
    position: absolute;
    transition: .4s;
}

.slider:before {
    background-color: #fff;
    bottom: 2px;
    content: "";
    height: 20px;
    left: 2px;
    width: 20px;
    border-radius: 50%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="%23f39c12" d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.64 5.64c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L5.64 5.64zm12.72 12.72c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41l-1.06-1.06zM18.36 5.64l-1.06 1.06c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0l1.06-1.06c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0zM6.7 17.3c-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41l-1.06-1.06c-.39-.39-1.02-.39-1.41 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

input:checked+.slider {
    background-color: var(--dark-highlight);
}

input:checked+.slider:before {
    transform: translateX(26px);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 24 24"><path fill="%23f1c40f" d="M11.23 2.51c.42-.13.86-.13 1.28 0 3.99 1.27 6.49 5.32 5.22 9.32-1.27 3.99-5.32 6.49-9.32 5.22-3.99-1.27-6.49-5.32-5.22-9.32 1.27-3.99 5.32-6.49 9.32-5.22zm-2.09 13.56c.79.44 1.73.44 2.52 0 .53-.29.83-.88.7-1.48-.13-.6-.62-1.09-1.22-1.22-.6-.13-1.19.17-1.48.7-.29.53-.29 1.19 0 1.73.18.32.49.53.83.67z"/></svg>');
}

body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

body.dark-mode .navbar {
    background-color: var(--dark-container-bg);
}

body.dark-mode .nav-signup {
    background: linear-gradient(135deg, #4599ff 0%, #3a80e6 100%);
    box-shadow: 0 4px 12px rgba(69, 153, 255, 0.4);
}

body.dark-mode .nav-signup:hover {
    background: linear-gradient(135deg, #5da3ff 0%, #4a90e2 100%);
    box-shadow: 0 8px 20px rgba(69, 153, 255, 0.55);
}

.site-footer {
    text-align: center;
    padding: 25px 20px;
    margin-top: 40px;
    background-color: #e9ecef;
    color: var(--light-secondary);
    font-size: .9rem;
    border-top: 1px solid #dee2e6;
    transition: background-color .3s, color .3s;
}

.site-footer a {
    color: var(--light-primary);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

body.dark-mode .site-footer {
    background-color: #2c3138;
    color: var(--dark-secondary);
    border-top: 1px solid var(--dark-container-bg);
}

body.dark-mode .site-footer a {
    color: var(--dark-primary);
}

/* Hamburger Menu Animations */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: 0 0;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    display: block;
    transform-origin: 2px 1px;
}

.hamburger-menu.active span:first-child {
    transform: rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(37,211,102,0.5);
}

@media (max-width: 480px) {
    .whatsapp-float {
        width: 54px;
        height: 54px;
        bottom: 20px;
        right: 20px;
    }
}