/**
 * Admin Panel Dedicated Stylesheet
 * Guarantees crisp, professional rendering of all buttons, forms, tables, and cards
 * independent of purged Tailwind CSS bundles.
 */

:root {
    --brand-primary: #15803d;
    --brand-hover: #166534;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
}

/* ==========================================================================
   BUTTONS (CRITICAL FIX FOR INVISIBLE BUTTONS & FORM SUBMISSIONS)
   ========================================================================== */

button,
input[type="button"],
input[type="submit"],
a.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-family: inherit;
    font-weight: 700 !important;
    text-decoration: none !important;
    line-height: 1.25 !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease-in-out !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Global button utility classes */
.btn-primary,
.bg-emerald-700,
.bg-brand,
#login-submit-btn,
#save-smtp-btn,
#save-profile-btn,
#upload-logo-btn,
#req-submit-btn,
#reset-submit-btn {
    background-color: var(--brand-primary, #15803d) !important;
    color: #ffffff !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.15);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.08) !important;
}

.btn-primary:hover,
.bg-emerald-700:hover,
.hover\:bg-emerald-800:hover,
#login-submit-btn:hover,
#save-smtp-btn:hover,
#save-profile-btn:hover,
#upload-logo-btn:hover,
#req-submit-btn:hover,
#reset-submit-btn:hover {
    background-color: var(--brand-hover, #166534) !important;
    color: #ffffff !important;
    filter: brightness(0.94);
}

/* Dark Slate Buttons (e.g. Save General Settings, Send Test Email, Dark Filter) */
.btn-dark,
.bg-slate-900,
.bg-slate-800,
#save-general-btn,
#send-test-email-btn {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15) !important;
}

.btn-dark:hover,
.bg-slate-900:hover,
.bg-slate-800:hover,
.hover\:bg-slate-800:hover,
.hover\:bg-slate-900:hover,
#save-general-btn:hover,
#send-test-email-btn:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

/* Light / Secondary Buttons */
.bg-slate-100 {
    background-color: var(--slate-100, #f1f5f9) !important;
    color: var(--slate-700, #334155) !important;
    border: 1px solid var(--slate-300, #cbd5e1) !important;
}

.bg-slate-100:hover,
.hover\:bg-slate-200:hover {
    background-color: var(--slate-200, #e2e8f0) !important;
    color: var(--slate-900, #0f172a) !important;
}

.bg-slate-200 {
    background-color: var(--slate-200, #e2e8f0) !important;
    color: var(--slate-700, #334155) !important;
}

.hover\:bg-slate-300:hover {
    background-color: var(--slate-300, #cbd5e1) !important;
}

/* Disabled state */
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.25) !important;
}

/* ==========================================================================
   TEXT COLORS & TYPOGRAPHY
   ========================================================================== */

.text-white { color: #ffffff !important; }
.text-slate-900 { color: #0f172a !important; }
.text-slate-800 { color: #1e293b !important; }
.text-slate-700 { color: #334155 !important; }
.text-slate-600 { color: #475569 !important; }
.text-slate-500 { color: #64748b !important; }
.text-slate-400 { color: #94a3b8 !important; }

.text-emerald-700 { color: #15803d !important; }
.text-emerald-800 { color: #166534 !important; }
.text-emerald-600 { color: #16a34a !important; }

.text-rose-600 { color: #e11d48 !important; }
.text-rose-700 { color: #be123c !important; }
.text-rose-800 { color: #9f1239 !important; }

.text-amber-700 { color: #b45309 !important; }
.text-amber-800 { color: #92400e !important; }
.text-amber-900 { color: #78350f !important; }

.text-sky-700 { color: #0369a1 !important; }

.text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
.text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
.text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }

.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }

/* ==========================================================================
   BACKGROUNDS & BADGES
   ========================================================================== */

.bg-white { background-color: #ffffff !important; }
.bg-slate-50 { background-color: #f8fafc !important; }
.bg-emerald-50 { background-color: #f0fdf4 !important; }
.bg-emerald-100 { background-color: #dcfce7 !important; }
.bg-emerald-200 { background-color: #bbf7d0 !important; }
.bg-emerald-600 { background-color: #16a34a !important; }

.bg-rose-50 { background-color: #fff1f2 !important; }
.bg-rose-100 { background-color: #ffe4e6 !important; }
.bg-rose-500 { background-color: #f43f5e !important; }

.bg-amber-50 { background-color: #fffbeb !important; }
.bg-amber-100 { background-color: #fef3c7 !important; }
.bg-amber-700 { background-color: #b45309 !important; }

.bg-sky-50 { background-color: #f0f9ff !important; }

/* ==========================================================================
   BORDERS
   ========================================================================== */

.border-slate-100 { border-color: #f1f5f9 !important; }
.border-slate-200 { border-color: #e2e8f0 !important; }
.border-slate-300 { border-color: #cbd5e1 !important; }
.border-emerald-200 { border-color: #bbf7d0 !important; }
.border-rose-200 { border-color: #fecdd3 !important; }
.border-amber-200 { border-color: #fde68a !important; }

/* ==========================================================================
   FORM INPUTS & SELECTS (ACCESSIBLE HIGH-CONTRAST BORDERS)
   ========================================================================== */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"],
select,
textarea {
    border: 1.5px solid #94a3b8 !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    box-sizing: border-box !important;
}

input[type="text"]:hover:not(:disabled),
input[type="password"]:hover:not(:disabled),
input[type="email"]:hover:not(:disabled),
input[type="url"]:hover:not(:disabled),
input[type="number"]:hover:not(:disabled),
input[type="tel"]:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
    border-color: #475569 !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    background-color: #ffffff !important;
    border-color: var(--brand-primary, #15803d) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.22) !important;
}

input.is-invalid,
select.is-invalid,
.is-invalid {
    border-color: #e11d48 !important;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.2) !important;
}

input.is-valid,
select.is-valid {
    border-color: #16a34a !important;
}

/* ==========================================================================
   BUTTON SIZING & PILLS
   ========================================================================== */

.h-9 { height: 36px !important; min-height: 36px !important; }
.h-10 { height: 40px !important; min-height: 40px !important; }
.h-11 { height: 44px !important; min-height: 44px !important; }

.px-2\.5 { padding-left: 10px !important; padding-right: 10px !important; }
.py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.py-1\.5 { padding-top: 6px !important; padding-bottom: 6px !important; }
.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.px-5 { padding-left: 20px !important; padding-right: 20px !important; }
.py-2\.5 { padding-top: 10px !important; padding-bottom: 10px !important; }
.px-6 { padding-left: 24px !important; padding-right: 24px !important; }

.rounded-lg { border-radius: 8px !important; }
.rounded-xl { border-radius: 12px !important; }
.rounded-full { border-radius: 9999px !important; }

/* Modals & Overlays */
.z-50 { z-index: 50 !important; }
.fixed { position: fixed !important; }
.inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }
.bg-black\/60 { background-color: rgba(0, 0, 0, 0.6) !important; }

/* ==========================================================================
   TABS & REPORT MODAL
   ========================================================================== */

.tab-active-success {
    border-bottom: 2px solid #15803d !important;
    color: #15803d !important;
}

.tab-active-failed {
    border-bottom: 2px solid #e11d48 !important;
    color: #e11d48 !important;
}

/* Candidate Report Card Definitions */
.report-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.report-section-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 20px;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding: 20px;
}

.report-field-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #64748b !important;
    margin-bottom: 3px !important;
}

.report-field-value {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    word-break: break-word !important;
}

/* Print Rules */
@media print {
    body * {
        visibility: hidden !important;
    }
    #candidate-report-modal,
    #candidate-report-modal * {
        visibility: visible !important;
    }
    #candidate-report-modal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        padding: 0 !important;
        z-index: 999999 !important;
    }
    #report-modal-container {
        max-width: 100% !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        overflow: visible !important;
        max-height: none !important;
    }
    #modal-report-body {
        overflow: visible !important;
        padding: 10px 0 !important;
        max-height: none !important;
    }
    .print-hide {
        display: none !important;
    }
}
