/* LEAKPROOF Brand Theme - Dark-Mode Blueprint Aesthetic */
/* Colors: Deep Charcoal (#2A2A2A), Architect White (#F5F5F5), Safety Orange (#FF6600) */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #2A2A2A;
    color: #F5F5F5;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Header */
header {
    color: #F5F5F5;
    margin-bottom: 40px;
    border-bottom: 2px solid #FF6600;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    color: #F5F5F5;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
}

.subtitle {
    font-size: 1rem;
    color: #B0B0B0;
    margin: 0;
    font-weight: 400;
    line-height: 1.2;
}

.api-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid #FF6600;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #F5F5F5;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FF6600;
    animation: pulse 2s infinite;
}

.status-indicator.healthy {
    background: #4ade80;
}

.status-indicator.error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Cards */
.card {
    background: #1F1F1F;
    border: 1px solid #3A3A3A;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.card h2 {
    color: #FF6600;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #F5F5F5;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px;
    background: #1A1A1A;
    border: 1px solid #3A3A3A;
    border-radius: 8px;
    font-size: 1rem;
    color: #F5F5F5;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #FF6600;
    background: #252525;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    color: #F5F5F5;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FF6600;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #FF6600;
    color: #1A1A1A;
    width: 100%;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.btn-primary:hover {
    background: #FF8533;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #3A3A3A;
    color: #F5F5F5;
    margin-bottom: 20px;
    border: 1px solid #4A4A4A;
}

.btn-secondary:hover {
    background: #4A4A4A;
    border-color: #FF6600;
}

/* Progress */
.progress {
    margin-top: 20px;
    text-align: center;
}

.progress-bar {
    height: 4px;
    background: #3A3A3A;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #FF6600, #FF8533);
    animation: progress 2s infinite;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

#progressText {
    color: #B0B0B0;
    font-size: 0.9rem;
}

/* Results */
.vip-result {
    border: 1px solid #3A3A3A;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #1F1F1F;
}

.vip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3A3A3A;
}

.vip-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #F5F5F5;
}

.vip-tier {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.vip-tier.premium {
    background: #FF6600;
    color: #1A1A1A;
}

.vip-tier.standard {
    background: #4A4A4A;
    color: #F5F5F5;
    border: 1px solid #FF6600;
}

.vip-tier.filtered {
    background: #3A1010;
    color: #FF6666;
    border: 1px solid #663333;
}

.scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.score-item {
    text-align: center;
    background: #1A1A1A;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #3A3A3A;
}

.score-label {
    font-size: 0.8rem;
    color: #B0B0B0;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF6600;
}

.vip-content {
    margin-top: 15px;
}

.vip-content p {
    margin-bottom: 10px;
    color: #D0D0D0;
}

.vip-content strong {
    color: #FF6600;
}

.script-section {
    background: #1A1A1A;
    border-left: 4px solid #FF6600;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
}

.script-section h4 {
    color: #FF6600;
    margin-bottom: 10px;
}

.script-section p {
    color: #D0D0D0;
    line-height: 1.8;
}

/* VIP Library */
.vip-library {
    display: grid;
    gap: 15px;
}

.vip-card {
    border: 1px solid #3A3A3A;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: #1F1F1F;
}

.vip-card:hover {
    border-color: #FF6600;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.2);
    transform: translateY(-2px);
}

.vip-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.vip-card-topic {
    font-weight: 700;
    color: #F5F5F5;
}

.vip-card-score {
    font-weight: 700;
    color: #FF6600;
}

.vip-card-meta {
    font-size: 0.85rem;
    color: #B0B0B0;
}

/* Loading */
.loading {
    text-align: center;
    color: #B0B0B0;
    padding: 20px;
}

/* Footer */
footer {
    text-align: center;
    color: #B0B0B0;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #3A3A3A;
}

.footer-note {
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Scripts Library */
.scripts-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-filter {
    padding: 8px 16px;
    border: 1px solid #3A3A3A;
    background: #1F1F1F;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #F5F5F5;
    transition: all 0.3s;
}

.btn-filter:hover {
    border-color: #FF6600;
    color: #FF6600;
}

.btn-filter.active {
    background: #FF6600;
    color: #1A1A1A;
    border-color: #FF6600;
}

.scripts-library {
    display: grid;
    gap: 15px;
}

.script-card {
    border: 1px solid #3A3A3A;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: #1F1F1F;
}

.script-card:hover {
    border-color: #FF6600;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.2);
    transform: translateY(-2px);
}

.script-card.approved {
    border-left: 4px solid #4ade80;
}

.script-card.pending {
    border-left: 4px solid #FF6600;
}

.script-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.script-card-topic {
    font-weight: 700;
    color: #F5F5F5;
}

.script-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.script-status.approved {
    background: #1A3A2A;
    color: #4ade80;
    border: 1px solid #4ade80;
}

.script-status.pending {
    background: #3A2010;
    color: #FF6600;
    border: 1px solid #FF6600;
}

.script-card-meta {
    font-size: 0.85rem;
    color: #B0B0B0;
    display: flex;
    gap: 15px;
    align-items: center;
}

.voice-badge {
    background: #FF6600;
    color: #1A1A1A;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #1F1F1F;
    border: 1px solid #3A3A3A;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

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

.modal-header h2 {
    color: #FF6600;
    margin: 0;
}

.modal-close {
    font-size: 2rem;
    font-weight: 300;
    color: #B0B0B0;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #FF6600;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 30px;
    border-top: 1px solid #3A3A3A;
    background: #1A1A1A;
}

/* Script Editor */
.script-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #1A1A1A;
    border-radius: 8px;
    border: 1px solid #3A3A3A;
}

.script-meta span:first-child {
    font-weight: 700;
    color: #F5F5F5;
    font-size: 1.1rem;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #1A1A1A;
    border: 1px solid #3A3A3A;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    color: #F5F5F5;
    transition: border-color 0.3s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #FF6600;
    background: #252525;
}

.script-stats {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: #1A1A1A;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #3A3A3A;
}

.script-stats span {
    color: #B0B0B0;
}

.script-stats strong {
    color: #FF6600;
    font-size: 1.1rem;
}

/* Button variants */
.btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: #4ade80;
    color: #1A1A1A;
    transition: all 0.3s;
}

.btn-success:hover {
    background: #22c55e;
    transform: translateY(-2px);
}

.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: #ef4444;
    color: #F5F5F5;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .header-branding {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-logo {
        height: 50px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }

    .scores {
        grid-template-columns: repeat(2, 1fr);
    }

    .scripts-filter {
        flex-wrap: wrap;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .script-card-meta {
        flex-wrap: wrap;
    }
}

/* Blueprint Grid Pattern (subtle background) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 102, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 102, 0, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}
