/* Gate Guard Security - Common Styles */

/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 50%, #1a202c 100%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    color: #ffffff;
    line-height: 1.6;
    /* Support for devices with notches/safe areas */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ===== COLOR SYSTEM ===== */
:root {
    /* Primary Colors */
    --primary-blue-dark: #1a365d;
    --primary-blue-medium: #2d3748;
    --primary-blue-darker: #1a202c;
    --primary-gold: #ffd700;
    --primary-gold-light: #ffed4e;
    
    /* Text Colors */
    --text-white: #ffffff;
    --text-light: #e2e8f0;
    --text-muted: #a0aec0;
    --text-dark-blue: #1a365d;
    
    /* Background Colors */
    --bg-card: rgba(26, 54, 93, 0.8);
    --bg-card-secondary: rgba(45, 55, 72, 0.8);
    --bg-card-tertiary: rgba(45, 55, 72, 0.6);
    --bg-header: rgba(26, 54, 93, 0.95);
    --bg-input: rgba(45, 55, 72, 0.8);
    
    /* Status Colors */
    --success-bg: rgba(72, 187, 120, 0.2);
    --success-border: rgba(72, 187, 120, 0.5);
    --success-text: #68d391;
    
    --error-bg: rgba(245, 101, 101, 0.2);
    --error-border: rgba(245, 101, 101, 0.5);
    --error-text: #fc8181;
    
    --warning-bg: rgba(255, 165, 0, 0.2);
    --warning-border: rgba(255, 165, 0, 0.5);
    --warning-text: #ffa500;
    
    /* Border Colors */
    --border-gold-subtle: rgba(255, 215, 0, 0.2);
    --border-gold-medium: rgba(255, 215, 0, 0.3);
    --border-gold-bright: rgba(255, 215, 0, 0.5);
    
    /* Shadows */
    --shadow-subtle: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 15px rgba(255, 215, 0, 0.3);
    --shadow-strong: 0 6px 20px rgba(255, 215, 0, 0.4);
    --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.3);
    --shadow-large: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== HEADER COMPONENTS ===== */
.header {
    background: var(--bg-header);
    padding: 1rem 0;
    box-shadow: var(--shadow-subtle);
    backdrop-filter: blur(10px);
}

.header--sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Extend into safe area */
    margin-left: calc(-1 * env(safe-area-inset-left));
    margin-right: calc(-1 * env(safe-area-inset-right));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.header--fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* Extend into safe area */
    padding-top: env(safe-area-inset-top);
    margin-left: calc(-1 * env(safe-area-inset-left));
    margin-right: calc(-1 * env(safe-area-inset-right));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo--small {
    font-size: 1.5rem;
}

.logo img {
    height: 3.5rem;
    width: auto;
}

.logo--small img {
    height: 2.5rem;
}

.phone {
    color: var(--primary-gold);
    font-weight: 600;
    font-size: 1.1rem;
}

.phone--small {
    font-size: 1rem;
}

/* ===== USER NAVIGATION ===== */
.user-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.user-info {
    color: var(--text-light);
    font-weight: 600;
}

.user-name {
    color: var(--primary-gold);
}

.logout-link {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--error-border);
}

.logout-link:hover {
    background: rgba(245, 101, 101, 0.3);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.logout-link--gold {
    background: transparent;
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
}

.logout-link--gold:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* ===== NAVIGATION LINKS ===== */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dashboard-link {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-gold);
    border-radius: 6px;
}

.dashboard-link:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-1px);
    text-decoration: none;
    transition: all 0.2s ease;
}

/* ===== USER ACCOUNT POPOVER ===== */
.user-name-clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
}

.user-name-clickable:hover {
    color: var(--text-white);
    text-decoration-color: var(--primary-gold);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.account-popover {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-gold-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-large);
    z-index: 9999;
    width: 320px;
    margin-top: 0.5rem;
}

/* Ensure user-section has relative positioning for popover anchor */
.user-section {
    position: relative;
}

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-gold-subtle);
}

.popover-header h3 {
    color: var(--primary-gold);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.popover-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popover-close:hover {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-text);
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.popover-content {
    padding: 1.5rem;
}

.popover-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.detail-item-small:last-child {
    border-bottom: none;
}

.detail-item-small .detail-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-item-small .detail-value {
    color: var(--text-white);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
    font-size: 0.9rem;
}

/* ===== TYPOGRAPHY ===== */
.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 2.5rem;
    color: var(--text-white);
    margin-bottom: 2rem;
    font-weight: 700;
}

.section-title--center {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-white);
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-title--medium {
    font-size: 2rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
}

.page-subtitle--small {
    font-size: 1.1rem;
}

/* ===== LAYOUT CONTAINERS ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
}

.centered-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    background: rgba(26, 54, 93, 0.9);
    padding: 3rem;
    border-radius: 16px;
    border: 2px solid var(--border-gold-subtle);
    box-shadow: var(--shadow-large);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 450px;
    margin-top: calc(6rem + env(safe-area-inset-top));
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-gold-subtle);
    transition: all 0.3s ease;
}

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

.card--hover:hover {
    transform: translateY(-5px);
    border-color: var(--border-gold-bright);
    box-shadow: var(--shadow-card);
}

.card--secondary {
    background: var(--bg-card-secondary);
    border: 2px solid rgba(255, 215, 0, 0.1);
}

.card--tertiary {
    background: var(--bg-card-tertiary);
}

.card--welcome {
    text-align: center;
    margin-bottom: 3rem;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-gold);
    text-align: center;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 1rem;
    text-align: center;
}

.card-content {
    color: var(--text-light);
    text-align: center;
    line-height: 1.6;
}

.card-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* ===== GRIDS ===== */
.grid {
    display: grid;
    gap: 2rem;
}

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

.grid--auto-fit-small {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--two-column {
    grid-template-columns: 1fr 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.grid--details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-light) 100%);
    color: var(--text-dark-blue);
    box-shadow: var(--shadow-medium);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

.btn--secondary {
    background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-medium) 100%);
    color: var(--primary-gold);
    border: 2px solid var(--primary-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn--secondary:hover {
    transform: translateY(-2px);
    border-color: var(--primary-gold);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
}

.btn--full-width {
    width: 100%;
}

.btn--large {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
}

.btn--medium {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
}

.btn--small {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
}

.btn--action {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-light) 100%);
    color: var(--text-dark-blue);
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn--action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-gold-subtle);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-white);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ===== MESSAGES ===== */
.messages {
    margin-bottom: 2rem;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.message--success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.message--error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.message--warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-gold {
    color: var(--primary-gold);
}

.text-light {
    color: var(--text-light);
}

.text-muted {
    color: var(--text-muted);
}

.text-white {
    color: var(--text-white);
}

.text-success {
    color: var(--success-text);
}

.text-error {
    color: var(--error-text);
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.font-weight-bold {
    font-weight: 700;
}

.font-weight-semibold {
    font-weight: 600;
}

.font-italic {
    font-style: italic;
}

.coming-soon {
    background: var(--bg-card-tertiary);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 1rem;
}

.footer-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.footer-note--fixed {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
}

.back-link {
    position: fixed;
    top: 6rem;
    left: 2rem;
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    z-index: 1001;
}

.back-link:hover {
    color: var(--primary-gold-light);
}

/* ===== SECTIONS ===== */
.features-section {
    background: var(--bg-card-secondary);
    padding: 4rem 2rem;
    margin: 2rem 0;
}

.services-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.services-section--card {
    background: var(--bg-card-tertiary);
    border-radius: 12px;
    margin: 2rem auto;
    max-width: 800px;
}

.footer {
    background: rgba(26, 32, 44, 0.95);
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-title {
    font-size: 1.5rem;
    color: var(--primary-gold);
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-text {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer-licenses {
    color: #718096;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(113, 128, 150, 0.3);
}

/* ===== DETAILS COMPONENTS ===== */
.detail-item {
    background: rgba(26, 54, 93, 0.6);
    padding: 1rem;
    border-radius: 8px;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.detail-value {
    color: var(--text-white);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ===== MOBILE HEADER COMPONENTS ===== */
/* Bootstrap-style responsive utilities */
.d-md-none {
    display: block !important;
}

.d-none {
    display: none !important;
}

.d-md-flex {
    display: none !important;
}

@media (min-width: 769px) {
    .d-md-none {
        display: none !important;
    }
    
    .d-md-flex {
        display: flex !important;
    }
}

/* Mobile compact header with expand toggle */
@media (max-width: 768px) {
    .header--sticky {
        background: rgba(26, 35, 54, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-gold-subtle);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-header-compact {
        padding: 0.5rem 1rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    
    .mobile-expand-btn {
        background: none;
        border: 1px solid var(--border-gold-subtle);
        color: var(--primary-gold);
        padding: 0.25rem;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    
    .mobile-expand-btn:hover {
        background: var(--primary-gold);
        color: var(--primary-blue-dark);
        border-color: var(--primary-gold);
    }
    
    .mobile-expand-btn svg {
        width: 16px;
        height: 16px;
        transition: transform 0.3s ease;
    }
    
    .mobile-expand-btn.expanded svg {
        transform: rotate(180deg);
    }
    
    .mobile-header-full {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .mobile-header-full.expanded {
        max-height: 500px;
    }
    
    .mobile-header-full-content {
        padding: 1rem;
        border-top: 1px solid var(--border-gold-subtle);
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .mobile-header-full-content .phone {
        margin-bottom: 0;
    }
    
    .mobile-header-full-content .nav-links {
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .mobile-header-full-content .user-section {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .user-section {
        flex-direction: column;
        gap: 0.5rem;
        position: relative;
    }

    .nav-links {
        gap: 1rem;
    }

    .dashboard-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .account-popover {
        width: 280px;
        right: 50%;
        transform: translateX(50%);
        left: auto;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo--small {
        font-size: 1.2rem;
    }
    
    .phone {
        font-size: 1rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .grid--auto-fit {
        grid-template-columns: 1fr;
    }
    
    .grid--auto-fit-small {
        grid-template-columns: 1fr;
    }
    
    .grid--two-column {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .grid--details {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        margin: 1rem;
        padding: 2rem;
        margin-top: 5rem;
    }
    
    .back-link {
        top: 5.5rem;
        left: 1rem;
    }
    
    .section-container {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .login-container {
        padding: 1.5rem;
    }
} 