/**
 * ENTERPRISE UI - Vending Machine Architecture Styles
 * Locked content, payment UI, chat interface, job grid, timer display
 * Part of Vending Machine Architecture
 * CKD 60.469 Compliant
 */

/* ========== CSS VARIABLES ========== */
:root {
    /* Brand Colors (Deep Blue & Gold) */
    --primary-blue: #001f3f;
    --accent-gold: #D4AF37;
    
    /* Additional Colors */
    --bg-light: #F6F9FC;
    --surface: #FFFFFF;
    --text-main: #32325D;
    --text-muted: #8898AA;
    --border-color: #E6EBF1;
    
    /* Status Colors */
    --success: #00a651;
    --warning: #ff6600;
    --error: #dc3545;
    
    /* Structural */
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow-lg: 0 15px 35px rgba(50,50,93,0.1), 0 5px 15px rgba(0,0,0,0.07);
    
    /* Typography */
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========== LOCKED CONTENT (BLUR/UNBLUR) ========== */
.locked-content {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.5s ease;
    background: #e9ecef;
    padding: 30px;
    border-radius: var(--radius-md);
    margin: 30px 0;
    border: 1px solid var(--border-color);
    position: relative;
}

.locked-content::before {
    content: '🔒 Premium Content';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-muted);
    z-index: 10;
    filter: none;
}

.locked-content.unlocked {
    filter: none;
    pointer-events: auto;
    user-select: auto;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.locked-content.unlocked::before {
    display: none;
}

/* ========== PAYMENT BOX ========== */
.payment-box {
    margin-top: 30px;
    padding: 30px;
    border-top: 2px solid var(--primary-blue);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.payment-box label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-main);
}

.payment-box input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.payment-box .btn {
    width: 100%;
    margin-top: 20px;
}

.payment-box.highlight {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0%, 100% { box-shadow: var(--shadow-lg); }
    50% { box-shadow: 0 0 30px var(--accent-gold); }
}

/* ========== REGION SELECTOR ========== */
.region-selector {
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.region-selector label {
    display: block;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.region-selector label:hover {
    background: #e3f2fd;
}

.region-selector input[type="radio"] {
    margin-right: 10px;
}

/* ========== GATED TIMER ========== */
.gated-timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    padding: 15px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    border: 2px solid var(--primary-blue);
}

.gated-timer .timer-icon {
    font-size: 1.5rem;
}

.gated-timer .timer-text {
    display: flex;
    flex-direction: column;
}

.gated-timer .timer-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gated-timer .timer-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-blue);
    font-family: 'Courier New', monospace;
}

.gated-timer .timer-value.timer-warning {
    color: var(--error);
    animation: timer-blink 1s infinite;
}

@keyframes timer-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== PAYMENT PROMPT MODAL ========== */
.payment-prompt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.payment-prompt-modal .modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modal-slide-up 0.3s ease;
}

@keyframes modal-slide-up {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.payment-prompt-modal h2 {
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.payment-prompt-modal .modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.payment-prompt-modal .btn {
    flex: 1;
}

/* ========== CHAT INTERFACE (P12 - Goda AI) ========== */
.chat-interface {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 500px;
    border: 1px solid var(--border-color);
}

.chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #fcfdff;
}

.chat-window .message {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    max-width: 80%;
    line-height: 1.5;
}

.chat-window .ai-message {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-blue);
    align-self: flex-start;
}

.chat-window .user-message {
    background: var(--primary-blue);
    color: white;
    align-self: flex-end;
}

.input-area {
    display: flex;
    padding: 20px;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    gap: 15px;
}

.input-area textarea {
    flex: 1;
    height: 50px;
    resize: none;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-stack);
    font-size: 1rem;
}

.input-area textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.1);
}

/* ========== JOB RESULTS GRID (P10 - Jobs) ========== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.job-card {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.job-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.job-card h3 {
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.job-card .company {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.job-card .location {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.placeholder-text {
    text-align: center;
    color: var(--text-muted);
    grid-column: 1 / -1;
    font-style: italic;
    padding: 40px;
}

/* ========== SEARCH BAR ========== */
.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-stack);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.1);
}

/* ========== BUTTONS ========== */
.btn {
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    text-align: center;
    font-family: var(--font-stack);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: #003366;
}

.btn-secondary {
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-gold {
    background: var(--accent-gold);
    color: var(--primary-blue);
}

.btn-gold:hover {
    background: #c49b2e;
}

/* ========== AUTHORITY STRIP ========== */
.authority-strip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--accent-gold);
    color: var(--primary-blue);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.authority-strip::before {
    content: '🏆';
    font-size: 1.2rem;
}

/* ========== FORMS ========== */
.input-form {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="email"],
textarea {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-stack);
    outline: none;
    transition: border-color 0.2s;
    flex: 1;
    min-width: 200px;
}

input:focus,
textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.1);
}

input.ckd-invalid,
textarea.ckd-invalid {
    border-color: var(--error);
}

/* ========== MOBILE RESPONSIVENESS ========== */
@media (max-width: 768px) {
    .gated-timer {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
    }
    
    .gated-timer .timer-label {
        font-size: 0.65rem;
    }
    
    .gated-timer .timer-value {
        font-size: 1rem;
    }
    
    .payment-box {
        padding: 20px;
    }
    
    .chat-interface {
        height: 400px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar,
    .input-form,
    .input-area {
        flex-direction: column;
    }
    
    .payment-prompt-modal .modal-content {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .payment-prompt-modal .modal-actions {
        flex-direction: column;
    }
}

/* ========== ACCESSIBILITY ========== */
.btn:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
