/* ========================================
   OMEGA PERMITS - CLIENT PORTAL BASE STYLES
   ========================================
   - Layout & Structure
   - Navbar
   - Footer
   - Auth & Forms
   - Utility Classes
   - Responsive
   ======================================== */

/* ===== CLIENT COLOR VARIABLES ===== */
:root {
    /* Primary brand colors */
    --primary: #0094ab;
    --primary-light: #e6fdff;
    --primary-dark: #005666;
    --secondary: #008296;
    
    /* Background colors */
    --client-bg: #fbfeff;
    --client-sidebar-bg: #fbfeff;
    --client-content-bg: #fbfeff;

    /* Text colors */
    --client-text: #fff;
    --client-text-secondary: #666;
    --client-text-muted: #888;

    /* Common design tokens */
    --client-card-radius: 0.4rem;
    --client-shadow: 0 2px 16px rgba(0,0,0,0.07);
    --client-border: #d4d4d4;
}

/* ===== LAYOUT & STRUCTURE ===== */
html, body {
    height: 100%;
    min-height: 100%;
}

body {
    background: var(--client-bg);
    margin: 0;
    padding-top: 70px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1 0 auto;
}

/* ===== NAVBAR ===== */
.navbar-black {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    padding: 0.5rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.logo-img {
    width: 220px;
    height: 50px;
    object-fit: contain;
    display: block;
}

.logout-link {
    color: #ff5252;
    background: #222;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    margin-left: auto;
    padding: 0.5rem 2.5rem;
    transition: background 0.2s, color 0.2s;
}

.logout-link:hover {
    background: #292929;
    color: #ff5252;
    border-radius: 4px;
}

/* ===== CLIENT LAYOUT NAVBAR ===== */
.navbar-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-secondary {
    background: var(--client-content-bg);
    box-shadow: var(--client-shadow);
    margin-bottom: 2rem;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.navbar-welcome {
    color: var(--primary);
    font-weight: 500;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    padding-left: 1.5rem;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    text-shadow: 0 1px 2px #fff8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-company-inline {
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 400;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.navbar-company-separator {
    color: #ccc;
    margin: 0 0.5rem;
    font-size: 1.1rem;
}

/* ===== FOOTER ===== */
footer {
    flex-shrink: 0;
    text-align: center;
    color: #888;
    font-size: 0.93rem;
    margin: 0;
    padding: 1.5rem 0 1.2rem 0;
    background: #f7fafc;
    border-top: 1px solid #e0e0e0;
    letter-spacing: 0.01em;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.03);
}

/* ===== AUTH PAGE SPLIT (LOGIN/REGISTER) ===== */
.page-split {
    display: flex;
    width: 100vw;
    box-sizing: border-box;
}

.split-section {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* ===== AUTH CARD & FORMS ===== */
.auth-card {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.custom-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group input,
.form-group label {
    width: 100%;
    box-sizing: border-box;
}

.floating-label {
    position: relative;
    margin-bottom: 2rem;
}

.floating-label input {
    width: 100%;
    padding: 1.25rem 1rem 0.5rem 1rem;
    font-size: 1.15rem;
    border: 1px solid #000000;
    border-radius: 0.5rem;
    transition: border-color 0.2s;
    outline: none;
}

.floating-label input:focus {
    border-color: var(--primary);
}

.floating-label label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: #888;
    font-size: 1rem;
    pointer-events: none;
    background: transparent;
    transition: 0.2s ease all;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    top: 0.35rem;
    left: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.1rem;
}

.submit-button {
    width: 70%;
    height: 3rem;
    font-size: 1.1rem;
    border-radius: 0.5rem;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    display: block;
    margin: 0 auto;
}

.submit-button:hover {
    background: var(--secondary);
}

.auth-form-link {
    margin-top: 1rem;
    width: 100%;
    text-align: center;
}

.auth-form-link a {
    color: #c37602;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 100;
}

/* ===== PASSWORD FIELD & TOGGLE ===== */
.toggle-password {
    position: absolute;
    top: 50%;
    right: 1.2rem;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
}

.password-card {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: 90vw;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    padding: 1rem 1.25rem;
    z-index: 10;
    border: 1px solid #e0e0e0;
}

/* ===== UTILITY CLASSES ===== */
.text-success {
    color: #28a745;
    margin-bottom: 1rem;
    text-align: center;
}

.text-danger {
    color: #ff4136;
    margin-bottom: 1rem;
    text-align: center;
}

.text-muted {
    color: #6c757d !important;
    font-style: italic;
}

input.readonly {
    background: #f5f5f5;
    color: #888;
    cursor: not-allowed;
    border-color: #e0e0e0;
    font-style: italic;
}

.info-message {
    background: #f5f8fa;
    color: #555;
    border-left: 4px solid #0074d9;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1rem;
}

.match-message {
    display: none;
    font-size: 0.95rem;
    margin-top: 0.3rem;
    color: red;
    position: static;
}

.match-message.match {
    color: green;
    display: block;
}

.match-message.no-match {
    color: red;
    display: block;
}

/* ===== SHARED BUTTON STYLES ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
    border: 2px solid #28a745;
}

.btn-success:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== SHARED FORM STYLES ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== SHARED MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e9ecef;
}

/* ===== SHARED STATUS BADGE STYLES ===== */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.status-in-progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-badge.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Status color classes for text */
.status-pending {
    color: #f39c12 !important;
    font-weight: 600;
}

.status-in-progress {
    color: #3498db !important;
    font-weight: 600;
}

.status-completed {
    color: #27ae60 !important;
    font-weight: 600;
}

.status-cancelled {
    color: #e74c3c !important;
    font-weight: 600;
}

/* ===== SHARED ALERT STYLES ===== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.5s ease-out;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .page-split {
        flex-direction: column;
    }
    .split-section.left,
    .split-section.right {
        display: none;
    }
    .split-section.center {
        flex: none;
        width: 100vw;
        min-height: 100vh;
        justify-content: center;
        align-items: center;
        display: flex;
    }
    .auth-card {
        max-width: 100vw;
        width: 100vw;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
        padding: 2rem 1rem;
    }
    
    /* Enhanced navbar for mobile */
    body {
        padding-top: 60px;
    }
    
    .navbar-black {
        padding: 0.4rem 0.8rem;
        min-height: 60px;
    }
    
    .logo-img {
        width: 160px;
        height: 36px;
    }
    
    .logout-link {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .navbar-secondary {
        margin-bottom: 1rem;
        min-height: 48px;
    }
    
    .navbar-welcome {
        font-size: 1rem;
        padding-left: 1rem;
        flex-wrap: wrap;
        line-height: 1.3;
    }
    
    .navbar-company-inline {
        font-size: 0.9rem;
    }
    
    /* Enhanced form controls for mobile */
    .form-control {
        padding: 0.9rem 0.8rem;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px; /* Touch-friendly */
    }
    
    .floating-label input {
        padding: 1.4rem 0.8rem 0.6rem 0.8rem;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    .floating-label label {
        left: 0.8rem;
    }
    
    .floating-label input:focus + label,
    .floating-label input:not(:placeholder-shown) + label {
        left: 0.8rem;
        top: 0.3rem;
        font-size: 0.8rem;
    }
    
    /* Enhanced buttons for mobile */
    .btn {
        padding: 0.9rem 1.2rem;
        font-size: 1rem;
    }
    
    .submit-button {
        width: 85%;
        height: 3.2rem;
        font-size: 1.1rem;
    }
    
    /* Enhanced modals for mobile */
    .modal-content {
        width: 95%;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px 20px 12px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 16px 20px;
    }
    
    .modal-footer {
        padding: 12px 20px 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Enhanced form groups for mobile */
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    /* Enhanced utility classes for mobile */
    .text-success,
    .text-danger {
        font-size: 0.95rem;
        text-align: center;
    }
    
    .alert {
        padding: 12px 16px;
        font-size: 14px;
        margin-bottom: 16px;
    }
    
    .info-message {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Enhanced footer for mobile */
    footer {
        padding: 1rem 0 1rem 0;
        font-size: 0.85rem;
    }
    
    /* Password toggle adjustments */
    .toggle-password {
        right: 1rem;
        min-height: 44px;
        min-width: 44px;
    }
    
    .password-card {
        width: 280px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ===== ENHANCED MOBILE & TABLET RESPONSIVENESS ===== */
/* Tablet styles (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .navbar-black {
        padding: 0.5rem 1rem;
    }
    
    .logo-img {
        width: 180px;
        height: 40px;
    }
    
    .navbar-welcome {
        font-size: 1.1rem;
        padding-left: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .form-control {
        padding: 0.8rem 0.75rem;
    }
}

/* Small mobile styles (up to 480px) */
@media (max-width: 480px) {
    body {
        padding-top: 56px;
    }
    
    .navbar-black {
        padding: 0.3rem 0.6rem;
        min-height: 56px;
    }
    
    .logo-img {
        width: 140px;
        height: 32px;
    }
    
    .logout-link {
        padding: 0.3rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .navbar-welcome {
        font-size: 0.95rem;
        padding-left: 0.8rem;
    }
    
    .navbar-company-inline {
        font-size: 0.85rem;
    }
    
    .floating-label input {
        padding: 1.3rem 0.6rem 0.5rem 0.6rem;
    }
    
    .floating-label label {
        left: 0.6rem;
    }
    
    .floating-label input:focus + label,
    .floating-label input:not(:placeholder-shown) + label {
        left: 0.6rem;
    }
    
    .form-control {
        padding: 0.8rem 0.6rem;
    }
    
    .submit-button {
        width: 90%;
        height: 3rem;
        font-size: 1rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 0.25rem;
    }
    
    .password-card {
        width: 260px;
    }
}

/* ===== TOUCH-FRIENDLY ENHANCEMENTS ===== */
@media (pointer: coarse) {
    /* For touch devices */
    /* .btn, */
    .form-control,
    .toggle-password,
    .modal-close {
        min-height: 44px;
        min-width: 44px;
    }
    
    .logout-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ===== LANDSCAPE PHONE ADJUSTMENTS ===== */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding-top: 52px;
    }
    
    .navbar-black {
        min-height: 48px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}
