/**
 * CPES Frontend Styles
 * 
 * Theme: Black + Yellow (#f1ea39)
 * Style: Sharp corners (no border-radius)
 * 
 * Owner: LINUXENIC Corporation
 * Updated: 2025-12-05
 */

:root {
    --cpes-bg-dark: #0a0a0a;
    --cpes-bg-medium: #111111;
    --cpes-bg-light: #1a1a1a;
    --cpes-primary: #f1ea39;
    --cpes-success: #f1ea39;
    --cpes-danger: #ff4444;
    --cpes-warning: #f1ea39;
    --cpes-text: #ffffff;
    --cpes-text-muted: #888888;
    --cpes-border: #f1ea39;
}

/* Dashboard */
.cpes-dashboard {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    position: relative;
}

/* Loading */
.cpes-loading {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cpes-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--cpes-bg-light);
    border-top-color: var(--cpes-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Messages */
.cpes-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 2px solid;
}
.cpes-message.success { background: rgba(241,234,57,0.1); border-color: var(--cpes-primary); color: var(--cpes-primary); }
.cpes-message.error { background: rgba(255,68,68,0.1); border-color: var(--cpes-danger); color: var(--cpes-danger); }

/* Section */
.cpes-section {
    background: var(--cpes-bg-medium);
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid var(--cpes-border);
}

.cpes-section h2 {
    color: var(--cpes-primary);
    margin: 0 0 25px;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Active Exam */
.cpes-active-exam {
    border-color: var(--cpes-primary);
    box-shadow: 0 0 30px rgba(241,234,57,0.2);
}

.cpes-exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.cpes-timer {
    font-family: 'Courier New', monospace;
    font-size: 48px;
    font-weight: bold;
    color: var(--cpes-primary);
    text-shadow: 0 0 20px rgba(241,234,57,0.5);
}

/* Info Grid */
.cpes-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.cpes-info-card {
    background: var(--cpes-bg-dark);
    padding: 20px;
    text-align: center;
    border: 1px solid #333;
}

.cpes-info-icon { font-size: 28px; margin-bottom: 10px; }
.cpes-info-label { color: var(--cpes-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.cpes-info-value { color: var(--cpes-primary); font-family: monospace; font-size: 16px; font-weight: bold; }

/* Credentials */
.cpes-credentials {
    background: var(--cpes-bg-dark);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #333;
}

.cpes-credentials h3 { color: var(--cpes-primary); margin: 0 0 15px; text-transform: uppercase; letter-spacing: 1px; }

.cpes-cred-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #222;
}

.cpes-cred-row:last-of-type { border-bottom: none; }

.cpes-cred-label { color: var(--cpes-text-muted); }
.cpes-cred-value { 
    color: var(--cpes-primary); 
    font-family: monospace; 
    background: var(--cpes-bg-medium); 
    padding: 8px 15px; 
    border: 1px solid #333;
}

/* Objective */
.cpes-objective {
    background: var(--cpes-bg-dark);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #333;
}

.cpes-objective h3 { color: var(--cpes-primary); margin: 0 0 15px; text-transform: uppercase; }
.cpes-objective p { color: var(--cpes-text-muted); margin: 0 0 15px; }
.cpes-objective ol { color: #ccc; line-height: 1.8; margin: 15px 0 15px 20px; }
.cpes-objective code { 
    display: block; 
    background: var(--cpes-bg-medium); 
    padding: 12px; 
    color: var(--cpes-primary); 
    font-size: 14px; 
    border: 1px solid #333;
}

/* Hint Box */
.cpes-hint-box {
    background: var(--cpes-bg-light);
    padding: 15px;
    margin-top: 15px;
    border-left: 3px solid var(--cpes-primary);
}

.cpes-hint-box p {
    color: var(--cpes-primary);
    margin: 0;
    font-size: 14px;
}

/* Flag Form */
.cpes-flag-form {
    background: var(--cpes-bg-dark);
    padding: 20px;
    border: 1px solid #333;
}

.cpes-flag-form h3 { color: var(--cpes-primary); margin: 0 0 15px; text-transform: uppercase; }

#cpes-flag-form {
    display: flex;
    gap: 15px;
}

#cpes-flag-form input {
    flex: 1;
    padding: 15px;
    background: var(--cpes-bg-medium);
    border: 2px solid #333;
    color: var(--cpes-text);
    font-family: monospace;
    font-size: 18px;
}

#cpes-flag-form input:focus {
    outline: none;
    border-color: var(--cpes-primary);
}

#cpes-flag-form input::placeholder {
    color: #555;
}

/* Flag Submitted */
.cpes-flag-submitted {
    background: rgba(241,234,57,0.1);
    border: 2px solid var(--cpes-primary);
    padding: 25px;
    text-align: center;
}

.cpes-flag-submitted h3 { color: var(--cpes-primary); margin: 0 0 10px; }
.cpes-flag-submitted p { color: #ccc; }

.cpes-report-notice {
    background: var(--cpes-bg-dark);
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #333;
}

.cpes-email-link {
    display: inline-block;
    color: var(--cpes-primary);
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
}

/* Scheduled Exam */
.cpes-scheduled-exam .cpes-schedule-card {
    background: var(--cpes-bg-dark);
    border: 2px solid var(--cpes-primary);
    padding: 30px;
    text-align: center;
    margin-bottom: 25px;
}

.cpes-schedule-date { color: var(--cpes-primary); font-size: 28px; font-weight: bold; text-transform: uppercase; }

.cpes-schedule-countdown {
    margin-top: 15px;
}

.cpes-countdown-value { font-size: 48px; font-weight: bold; color: var(--cpes-text); }
.cpes-countdown-label { display: block; color: var(--cpes-text-muted); text-transform: uppercase; letter-spacing: 2px; }

.cpes-schedule-info { color: var(--cpes-text-muted); margin-bottom: 20px; }
.cpes-cancel-note { color: var(--cpes-text-muted); font-size: 12px; margin-top: 10px; }

/* Calendar */
.cpes-calendar-wrapper {
    background: var(--cpes-bg-dark);
    padding: 20px;
    border: 1px solid #333;
}

.cpes-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cpes-cal-title { color: var(--cpes-text); font-size: 20px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }

.cpes-cal-nav {
    background: var(--cpes-bg-medium);
    border: 2px solid var(--cpes-primary);
    color: var(--cpes-primary);
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.cpes-cal-nav:hover { 
    background: var(--cpes-primary); 
    color: #000; 
}

.cpes-calendar-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.cpes-legend-item { display: flex; align-items: center; gap: 8px; color: var(--cpes-text-muted); font-size: 13px; }
.cpes-legend-color { width: 16px; height: 16px; }
.cpes-legend-color.cpes-available { background: var(--cpes-primary); }
.cpes-legend-color.cpes-booked { background: var(--cpes-danger); }

.cpes-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cpes-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: default;
    transition: all 0.2s;
    border: 1px solid #222;
    background: var(--cpes-bg-medium);
    color: #555;
}

.cpes-calendar-day.available {
    background: transparent;
    border-color: var(--cpes-primary);
    color: var(--cpes-primary);
    cursor: pointer;
}

.cpes-calendar-day.available:hover {
    background: var(--cpes-primary);
    color: #000;
    transform: scale(1.05);
}

.cpes-calendar-day.booked {
    background: rgba(255,68,68,0.2);
    border-color: var(--cpes-danger);
    color: var(--cpes-danger);
}

.cpes-calendar-day.your_booking {
    background: var(--cpes-primary);
    border-color: var(--cpes-primary);
    color: #000;
}

.cpes-calendar-day.past {
    background: #111;
    border-color: #222;
    color: #333;
}

/* Modal */
.cpes-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.cpes-modal-content {
    background: var(--cpes-bg-medium);
    padding: 30px;
    max-width: 400px;
    text-align: center;
    border: 2px solid var(--cpes-primary);
}

.cpes-modal-content h3 { color: var(--cpes-primary); margin: 0 0 20px; text-transform: uppercase; }
.cpes-modal-date { font-size: 24px; font-weight: bold; color: var(--cpes-text); margin: 20px 0; }
.cpes-modal-warning { color: var(--cpes-text-muted); font-size: 14px; margin-bottom: 25px; }

.cpes-modal-actions { display: flex; gap: 15px; justify-content: center; }

/* Buttons */
.cpes-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cpes-btn-primary { 
    background: var(--cpes-primary); 
    border-color: var(--cpes-primary);
    color: #000; 
}
.cpes-btn-primary:hover { 
    background: transparent; 
    color: var(--cpes-primary); 
}

.cpes-btn-secondary { 
    background: transparent; 
    color: var(--cpes-text); 
    border-color: #555; 
}
.cpes-btn-secondary:hover { 
    border-color: var(--cpes-primary);
    color: var(--cpes-primary);
}

.cpes-btn-success { 
    background: var(--cpes-primary); 
    border-color: var(--cpes-primary);
    color: #000; 
}
.cpes-btn-success:hover {
    background: transparent;
    color: var(--cpes-primary);
}

.cpes-btn-danger { 
    background: transparent; 
    border-color: var(--cpes-danger);
    color: var(--cpes-danger); 
}
.cpes-btn-danger:hover {
    background: var(--cpes-danger);
    color: #fff;
}

.cpes-btn-large { padding: 16px 40px; font-size: 16px; }

/* Badges */
.cpes-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid;
}

.cpes-badge-scheduled { background: transparent; border-color: var(--cpes-primary); color: var(--cpes-primary); }
.cpes-badge-active { background: var(--cpes-primary); border-color: var(--cpes-primary); color: #000; }
.cpes-badge-completed { background: transparent; border-color: #666; color: #666; }
.cpes-badge-expired { background: transparent; border-color: #444; color: #444; }
.cpes-badge-cancelled { background: transparent; border-color: var(--cpes-danger); color: var(--cpes-danger); }
.cpes-badge-passed { background: var(--cpes-primary); border-color: var(--cpes-primary); color: #000; }
.cpes-badge-failed { background: transparent; border-color: var(--cpes-danger); color: var(--cpes-danger); }
.cpes-badge-pending { background: transparent; border-color: var(--cpes-primary); color: var(--cpes-primary); }

/* History Table */
.cpes-history-table {
    width: 100%;
    border-collapse: collapse;
}

.cpes-history-table th,
.cpes-history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #222;
}

.cpes-history-table th {
    background: var(--cpes-bg-dark);
    color: var(--cpes-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
}

.cpes-history-table td { color: var(--cpes-text); }
.cpes-history-table tr:hover { background: rgba(241,234,57,0.05); }

/* No Attempts */
.cpes-no-attempts { text-align: center; }
.cpes-no-attempts p { color: var(--cpes-text-muted); }

.cpes-purchase-cta { margin-top: 30px; }
.cpes-price-display { margin-bottom: 10px; }
.cpes-price-currency { font-size: 20px; color: var(--cpes-text-muted); }
.cpes-price-amount { font-size: 48px; font-weight: bold; color: var(--cpes-primary); }
.cpes-price-note { color: var(--cpes-text-muted); margin-bottom: 20px; }

/* Login Required */
.cpes-login-required {
    text-align: center;
    padding: 60px 20px;
    background: var(--cpes-bg-medium);
    border: 2px solid var(--cpes-border);
}

.cpes-login-required h3 { color: var(--cpes-primary); }
.cpes-login-required p { color: var(--cpes-text-muted); }

/* Attempts Info */
.cpes-attempts-info {
    color: var(--cpes-text-muted);
    margin-bottom: 20px;
}

.cpes-attempts-info strong {
    color: var(--cpes-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .cpes-timer { font-size: 32px; }
    .cpes-exam-header { flex-direction: column; gap: 15px; text-align: center; }
    #cpes-flag-form { flex-direction: column; }
    .cpes-modal-actions { flex-direction: column; }
    .cpes-cred-row { flex-direction: column; gap: 8px; text-align: center; }
}