/**
 * Contact Form Submitter Agent - Liquid Glass Transparent Dashboard CSS
 * Inspired by Mailey's cybernetic glassmorphism UI
 */

.cfa-glass-root *,
.cfa-glass-root *:before,
.cfa-glass-root *:after {
    box-sizing: border-box !important;
}

.cfa-glass-root {
    position: relative !important;
    width: 100% !important;
    max-width: 1360px !important;
    margin: 20px auto !important;
    color: #e8f2ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    border-radius: 16px !important;
    background: rgba(11, 22, 35, 0.65) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(56, 189, 248, 0.18) !important;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    overflow: hidden !important;
    min-height: 680px;
    display: flex;
    flex-direction: column;
}

/* Header bar */
.cfa-glass-header {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 28, 44, 0.55);
    border-bottom: 1px solid rgba(56, 189, 248, 0.16);
    padding: 18px 26px;
    position: relative;
    z-index: 10;
}

.cfa-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cfa-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 19px;
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.35);
}

.cfa-brand-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(90deg, #ffffff, #7dd3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.cfa-brand-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(6, 182, 212, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.cfa-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Primary Glass Button */
.cfa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.cfa-btn-primary {
    background: linear-gradient(135deg, #0284c7, #0284c7 40%, #06b6d4);
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cfa-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.45);
}

.cfa-btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: #bae6fd !important;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.cfa-btn-glass:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.45);
}

.cfa-btn-sm {
    padding: 5px 11px;
    font-size: 12px;
    border-radius: 7px;
}

/* Main body wrapper */
.cfa-main-wrapper {
    display: flex;
    flex: 1;
    min-height: 580px;
}

/* Sidebar navigation */
.cfa-sidebar {
    width: 230px;
    background: rgba(9, 19, 31, 0.6);
    border-right: 1px solid rgba(56, 189, 248, 0.12);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cfa-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.18s ease;
    cursor: pointer;
}

.cfa-nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.cfa-nav-item:hover {
    color: #e0f2fe;
    background: rgba(56, 189, 248, 0.08);
}

.cfa-nav-item.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.28);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.12);
    font-weight: 600;
}

/* Main content view */
.cfa-content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: transparent;
}

.cfa-tab-panel {
    display: none;
}

.cfa-tab-panel.active {
    display: block;
    animation: cfaFadeIn 0.25s ease-out;
}

@keyframes cfaFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Cards Grid */
.cfa-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.cfa-stat-card {
    background: rgba(14, 27, 43, 0.55);
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: 14px;
    padding: 18px 20px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cfa-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #7dd3fc;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cfa-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.cfa-stat-sub {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 4px;
}

/* Table Cards */
.cfa-card {
    background: rgba(14, 27, 43, 0.55);
    border: 1px solid rgba(56, 189, 248, 0.16);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

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

.cfa-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #f0f9ff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* Modern Glass Table */
.cfa-table-responsive {
    overflow-x: auto;
}

.cfa-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    text-align: left;
}

.cfa-table th {
    padding: 12px 14px;
    background: rgba(56, 189, 248, 0.07);
    color: #7dd3fc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.16);
}

.cfa-table th:first-child { border-top-left-radius: 8px; }
.cfa-table th:last-child { border-top-right-radius: 8px; }

.cfa-table td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    vertical-align: middle;
}

.cfa-table tr:hover td {
    background: rgba(56, 189, 248, 0.04);
}

/* Status Badges */
.cfa-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.cfa-badge-submitted {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.cfa-badge-running {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    animation: cfaPulse 1.8s infinite;
}

.cfa-badge-scheduled,
.cfa-badge-recurring {
    background: rgba(168, 85, 247, 0.14);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.3);
}

.cfa-badge-failed,
.cfa-badge-captcha_detected {
    background: rgba(244, 63, 94, 0.14);
    color: #fb7185;
    border: 1px solid rgba(251, 113, 133, 0.3);
}

.cfa-badge-pending,
.cfa-badge-queued {
    background: rgba(234, 179, 8, 0.14);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

@keyframes cfaPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Forms & Inputs */
.cfa-form-group {
    margin-bottom: 16px;
}

.cfa-form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #bae6fd;
    margin-bottom: 6px;
}

.cfa-form-input,
.cfa-form-textarea,
.cfa-form-select {
    width: 100%;
    background: rgba(11, 23, 38, 0.75) !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    border-radius: 9px !important;
    padding: 10px 14px !important;
    color: #f1f5f9 !important;
    font-size: 13.5px !important;
    outline: none !important;
    transition: all 0.2s ease;
}

.cfa-form-input:focus,
.cfa-form-textarea:focus,
.cfa-form-select:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.3) !important;
}

.cfa-form-textarea {
    resize: vertical;
    min-height: 90px;
}

/* Modal Dialog */
.cfa-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 12, 20, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cfa-modal-overlay.active {
    display: flex;
}

.cfa-modal {
    width: 100%;
    max-width: 680px;
    background: #0f1d2e;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.cfa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: rgba(56, 189, 248, 0.07);
    border-bottom: 1px solid rgba(56, 189, 248, 0.16);
}

.cfa-modal-body {
    padding: 22px;
    overflow-y: auto;
}

.cfa-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    background: rgba(15, 28, 44, 0.5);
    border-top: 1px solid rgba(56, 189, 248, 0.12);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cfa-main-wrapper {
        flex-direction: column;
    }
    .cfa-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(56, 189, 248, 0.12);
        flex-direction: row;
        overflow-x: auto;
    }
}
