/* ==========================================================================
   CAPITAL G PROPERTIES - ENTERPRISE STYLESHEET
   ========================================================================== */

/* Skip to main content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--gold-primary);
    color: #000;
    padding: 8px;
    z-index: 1000000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* UI/UX Animations */
.js-enabled .animate-on-scroll:not(.fade-in-up) {
    opacity: 0;
    transform: translateY(20px);
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) both;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

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

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:root {
    /* Color Palette */
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-darker: #050505;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --gold-primary: #D4AF37;
    --gold-dim: rgba(212, 175, 55, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;

    /* Layout Constraints */
    --container-width: 1200px;
    --transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --------------------------------------------------------------------------
   RESET & BASE
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #333 var(--bg-darker);
}

/* Global Responsive Media */
img, picture, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Prevent iOS input zoom on focus */
input, select, textarea {
    font-size: 16px !important;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Custom Webkit Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    max-width: 75ch;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   LAYOUT & UTILITIES
   -------------------------------------------------------------------------- */
.container {
    width: 92%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

.text-center { text-align: center; }
.gold-text { color: var(--gold-primary) !important; }
.serif { font-family: var(--font-serif); }

.kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold-primary);
    font-weight: 700;
    display: block;
    margin-bottom: 15px;
}

.divider {
    height: 1px;
    width: 100%;
    background-color: var(--border-color);
    margin: 30px 0;
}

.section-padding {
    padding: 100px 0;
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border: 1px solid var(--gold-primary);
    transition: var(--transition);
    text-decoration: none;
    background: transparent;
}

.btn-solid {
    background: var(--gold-primary);
    color: #000;
}

.btn-solid:hover, .btn-solid:focus {
    background: #fff;
    border-color: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--gold-primary);
}

.btn-outline:hover, .btn-outline:focus {
    background: var(--gold-primary);
    color: #000;
}

.btn-subtle {
    font-size: 0.7rem;
    padding: 8px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #ccc;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-subtle:hover, .btn-subtle:focus {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

/* --------------------------------------------------------------------------
   NAVIGATION & HEADER
   -------------------------------------------------------------------------- */
header#navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    z-index: 99990;
    position: relative;
}

.header-top-row {
    padding: 20px 0;
    border-bottom: 1px solid #111;
}

.top-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
    display: block;
}

.brand-area {
    display: flex;
    align-items: center;
}

.header-nav-row {
    background: #080808;
    padding: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
    justify-content: center;
}

.nav-links > li {
    position: relative;
}

.nav-links > li > a {
    display: block;
    padding: 18px 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links > li:hover > a {
    color: var(--gold-primary);
}

/* Desktop Dropdown Menus */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    min-width: 220px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8);
    border: 1px solid #333;
    border-top: 2px solid var(--gold-primary);
    z-index: 99995;
    padding: 10px 0;
}

.dropdown-content a {
    display: block;
    padding: 12px 25px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.dropdown-content a:hover, .dropdown-content a:focus {
    background: #1a1a1a;
    color: var(--gold-primary);
    padding-left: 30px;
}

.nav-links .dropdown:hover .dropdown-content {
    display: block;
}

/* --------------------------------------------------------------------------
   PORTAL / DASHBOARD
   -------------------------------------------------------------------------- */
.portal-wrapper {
    display: flex;
    align-items: flex-start;
    min-height: 80vh;
    padding-top: 40px;
}

.portal-main-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 60px;
    background: transparent;
}

.portal-main-content .container {
    width: 100%;
    max-width: none;
    padding: 0 40px;
}

.portal-sidebar {
    width: 280px;
    background: transparent;
    border-right: 1px solid var(--border-color);
    padding: 0 30px 40px 0;
    position: sticky;
    top: 40px;
    height: calc(100vh - 40px);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section { margin-bottom: 40px; }

.sidebar-title {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 700;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 8px;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 8px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: #aaa;
    padding: 10px 12px;
    border-radius: 4px;
    transition: var(--transition);
    font-weight: 600;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: #111;
    color: var(--gold-primary);
}

.grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 40px 30px;
    transition: var(--transition);
}

.grid-card:hover {
    border-color: var(--gold-dim);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.highlight-card {
    border-top: 3px solid var(--gold-primary);
}

.dash-hero {
    padding: 80px 0 40px;
    background: radial-gradient(circle at 50% 0%, #151515 0%, #0a0a0a 100%);
    border-bottom: 1px solid #1a1a1a;
}

.role-badge {
    color: var(--gold-primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    display: block;
    margin-bottom: 10px;
}

.dash-greeting {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   AUTHENTICATION & FORMS
   -------------------------------------------------------------------------- */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 75vh;
    padding: 60px 20px;
    background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-container.wide { max-width: 500px; }
.auth-container.error-wide { max-width: 600px; }

.auth-card {
    background: #121212;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold-primary);
}

.auth-card.critical::before { background: #ff4444; }

.auth-logo {
    width: 80px;
    margin: 0 auto 25px;
    display: block;
}

.auth-header { margin-bottom: 40px; }

.auth-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #fff;
    font-family: var(--font-serif);
}

.auth-header p {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-alert-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 12px;
    font-size: 0.85rem;
    margin-bottom: 25px;
    text-align: left;
}

.auth-alert-success {
    background: rgba(75, 181, 67, 0.1);
    border: 1px solid #4BB543;
    color: #4BB543;
    padding: 12px;
    font-size: 0.85rem;
    margin-bottom: 25px;
    text-align: left;
}

.form-row { display: flex; gap: 15px; }

.form-group { text-align: left; margin-bottom: 20px; flex: 1; }

.form-group label {
    display: block;
    color: #888;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.login-input {
    width: 100%;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    padding: 15px;
    font-size: 1rem;
    outline: none;
    border-radius: 0;
    transition: border-color 0.3s;
}

.login-input:focus { border-color: var(--gold-primary); }

/* Remove Chrome Auto-fill styling */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #000 inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
    border: 1px solid #333 !important;
}

.login-input:focus:-webkit-autofill {
    border: 1px solid var(--gold-primary) !important;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: var(--gold-primary);
    color: #000;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.btn-login:hover, .btn-login:focus {
    background: #fff;
    transform: translateY(-2px);
    outline: none;
}

.auth-footer {
    margin-top: 30px;
    border-top: 1px solid #222;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

.auth-link {
    font-size: 0.75rem;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.auth-link:hover { color: #fff; }

.auth-link-alt {
    color: var(--text-secondary);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
    float: right;
}

.auth-link-alt:hover { color: var(--gold-primary); }

/* --------------------------------------------------------------------------
   MOBILE NAV TOGGLE (HAMBURGER)
   -------------------------------------------------------------------------- */
.mobile-toggle {
    display: none; /* Default hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    cursor: pointer;
    z-index: 100000;
}

.mobile-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--gold-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mobile-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   RESPONSIVE QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .desktop-only {
        display: none !important;
    }

    /* Enable Hamburger */
    .mobile-toggle {
        display: flex;
    }

    /* Mobile Menu Drawer Logic (Controlled by JS .active class) */
    .header-nav-row {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 99999;
        background: #080808;
        border-bottom: 1px solid #222;
        max-height: 85vh;
        overflow-y: auto;
        box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    }

    .header-nav-row.active {
        display: block;
        animation: slideDown 0.3s ease forwards;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        text-align: left;
    }

    .nav-links > li {
        border-bottom: 1px solid #1a1a1a;
    }

    .nav-links > li > a {
        padding: 20px 25px;
        font-size: 0.85rem;
    }

    /* Convert desktop dropdowns to static accordion format */
    .dropdown-content {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        display: block;
        background: #050505;
        border-left: 3px solid var(--gold-dim);
        padding: 5px 0 15px 0;
    }

    .nav-links .dropdown:hover .dropdown-content {
        display: block; /* Already block, ensures override */
    }

    .dropdown-content a {
        padding: 12px 30px;
        font-size: 0.75rem;
    }

    /* Portal Layout Shifts */
    .portal-wrapper {
        flex-direction: column;
        padding-top: 0;
    }

    .portal-main-content .container {
        padding: 0 15px;
    }

    .portal-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px 15px;
    }

    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .sidebar-nav li {
        margin: 0;
    }

    .sidebar-nav a {
        background: #111;
        border: 1px solid #222;
        border-radius: 4px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Make grid wrappers stack vertically on small screens */
    .grid-wrapper {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    .checkout-layout, .product-layout, .profile-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .dash-greeting {
        font-size: 2rem;
    }
    .auth-card {
        padding: 40px 25px;
    }
}
