/**
 * User Dashboard Frontend Styles
 * Minimal overrides - inherits from admin/css/tmcd-overview.css
 * 
 * @package TempMailsMultiDomain
 * @since 2.0.0 (BYOD Phase 2)
 */

/* ==========================================================================
   Dashboard Container (Frontend Wrapper)
   ========================================================================== */

.tmcd-user-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* ==========================================================================
   Header (User Dashboard Specific)
   ========================================================================== */

.tmcd-dashboard-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 0;
}

.tmcd-dashboard-header h1 {
    font-size: 32px;
    font-weight: 600;
    color: #0F172A;
    margin: 0 0 8px 0;
}

.tmcd-dashboard-header p {
    font-size: 16px;
    color: #64748B;
    margin: 0;
}

/* ==========================================================================
   Tabs Navigation (User Dashboard Specific)
   ========================================================================== */

.tmcd-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #E2E8F0;
    padding: 0;
}

.tmcd-tab {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.tmcd-tab:hover {
    color: #2563EB;
}

.tmcd-tab.active {
    color: #2563EB;
    border-bottom-color: #2563EB;
}

/* ==========================================================================
   Tab Content Panels
   ========================================================================== */

.tmcd-tab-content {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tmcd-tab-panel {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Stat Grid Override (Horizontal 4-Column Layout)
   ========================================================================== */

.tmcd-user-dashboard .tmcd-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* ==========================================================================
   Quota Box - Overview Tab (NEW)
   ========================================================================== */

.tmcd-quota-box-overview {
    background: #FFFFFF;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.tmcd-quota-box-overview .tmcd-quota-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tmcd-quota-box-overview .tmcd-quota-header .material-symbols-outlined {
    font-size: 24px;
    color: #475569;
}

.tmcd-quota-box-overview .tmcd-quota-header strong {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
}

.tmcd-quota-box-overview .tmcd-quota-text {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
}

.tmcd-quota-box-overview .tmcd-quota-progress {
    width: 100%;
    height: 24px;
    background: #F1F5F9;
    border-radius: 8px;
    overflow: visible;
    position: relative;
}

.tmcd-quota-box-overview .tmcd-quota-progress-bar {
    height: 100%;
    border-radius: 8px;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    position: relative;
}

.tmcd-quota-percentage {
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Progress Bar Color Variants */
.tmcd-progress-blue {
    background: linear-gradient(90deg, #3B82F6 0%, #2563EB 100%);
}

.tmcd-progress-orange {
    background: linear-gradient(90deg, #FB923C 0%, #F59E0B 100%);
}

.tmcd-progress-red {
    background: linear-gradient(90deg, #F87171 0%, #EF4444 100%);
}

/* ==========================================================================
   Quick Actions Section (NEW)
   ========================================================================== */

.tmcd-quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: #F8FAFC;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.tmcd-quick-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tmcd-quick-actions .button .material-symbols-outlined {
    font-size: 20px;
}

/* ==========================================================================
   Action Buttons in Table (NEW)
   ========================================================================== */

.tmcd-domains-table .tmcd-actions {
    white-space: nowrap;
}

.tmcd-btn-icon {
    background: transparent;
    border: 1px solid #E5E7EB;
    padding: 6px 8px;
    margin: 0 2px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.tmcd-btn-icon .material-symbols-outlined {
    font-size: 18px;
    color: #475569;
}

.tmcd-btn-icon:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.tmcd-btn-test-domain:hover .material-symbols-outlined {
    color: #2563EB;
}

.tmcd-btn-edit-domain:hover .material-symbols-outlined {
    color: #F59E0B;
}

.tmcd-btn-delete-domain:hover .material-symbols-outlined {
    color: #EF4444;
}

.tmcd-btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   IMAP Status Indicators (NEW)
   ========================================================================== */

.tmcd-imap-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: help;
}

.tmcd-imap-status .material-symbols-outlined {
    font-size: 16px;
}

.tmcd-imap-connected {
    background: #DCFCE7;
    color: #166534;
}

.tmcd-imap-connected .material-symbols-outlined {
    color: #16A34A;
}

.tmcd-imap-failed {
    background: #FEE2E2;
    color: #991B1B;
}

.tmcd-imap-failed .material-symbols-outlined {
    color: #DC2626;
}

.tmcd-imap-unknown {
    background: #F1F5F9;
    color: #475569;
}

.tmcd-imap-unknown .material-symbols-outlined {
    color: #64748B;
}

.tmcd-imap-label {
    white-space: nowrap;
}

/* ==========================================================================
   Quota Box (User-Specific Component - Add Domain Tab)
   ========================================================================== */

.tmcd-quota-box {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border: 2px solid #93C5FD;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.tmcd-quota-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tmcd-quota-header .material-symbols-outlined {
    font-size: 24px;
    color: #2563EB;
}

.tmcd-quota-header strong {
    font-size: 16px;
    color: #1E40AF;
}

.tmcd-quota-content p {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #1E3A8A;
}

.tmcd-quota-content strong {
    color: #1E40AF;
}

/* Progress Bar */
.tmcd-quota-progress {
    width: 100%;
    height: 8px;
    background: #FFFFFF;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tmcd-quota-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6 0%, #2563EB 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ==========================================================================
   Info Box (User-Specific Component)
   ========================================================================== */

.tmcd-info-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
}

.tmcd-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tmcd-info-header .material-symbols-outlined {
    font-size: 20px;
    color: #2563EB;
}

.tmcd-info-header strong {
    font-size: 14px;
    color: #0F172A;
}

.tmcd-info-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.tmcd-user-instructions {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 0;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

/* ==========================================================================
   Add Domain Header (User-Specific)
   ========================================================================== */

.tmcd-add-header {
    margin-bottom: 24px;
}

.tmcd-add-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #0F172A;
    margin: 0 0 8px 0;
}

.tmcd-add-header p {
    font-size: 14px;
    color: #64748B;
    margin: 0;
}

/* ==========================================================================
   Frontend Form Overrides (User Context)
   ========================================================================== */

.tmcd-user-dashboard .form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.tmcd-user-dashboard .tmcd-test-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.tmcd-user-dashboard .tmcd-test-result.tmcd-test-success {
    background: #DCFCE7;
    border-left: 4px solid #16A34A;
    color: #166534;
}

.tmcd-user-dashboard .tmcd-test-result.tmcd-test-error {
    background: #FEE2E2;
    border-left: 4px solid #DC2626;
    color: #991B1B;
}

/* ==========================================================================
   Button Overrides (Material Design 3 Compliance)
   ========================================================================== */

.tmcd-user-dashboard .button {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #475569;
    min-height: 44px;
    transition: all 0.18s ease;
}

.tmcd-user-dashboard .button:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
}

.tmcd-user-dashboard .button-primary {
    background: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tmcd-user-dashboard .button-primary:hover {
    background: #1D4ED8;
    border-color: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.25);
}

.tmcd-user-dashboard .button-primary:active {
    transform: translateY(0);
    background: #1E40AF;
}

.tmcd-user-dashboard .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==========================================================================
   Responsive Design (Mobile Overrides)
   ========================================================================== */

@media (max-width: 768px) {
    .tmcd-user-dashboard {
        padding: 16px;
    }

    .tmcd-tab-content {
        padding: 20px;
    }

    .tmcd-dashboard-header h1 {
        font-size: 24px;
    }

    .tmcd-tabs {
        flex-wrap: wrap;
    }

    .tmcd-tab {
        flex: 1 1 auto;
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Stack stat cards on mobile (4 cards to 1 column) */
    .tmcd-user-dashboard .tmcd-stat-grid {
        grid-template-columns: 1fr;
    }

    .tmcd-quota-box,
    .tmcd-quota-box-overview {
        padding: 16px;
    }

    /* Quick actions stack on mobile */
    .tmcd-quick-actions {
        flex-direction: column;
    }

    .tmcd-quick-actions .button {
        width: 100%;
        justify-content: center;
    }

    /* Hide Submitted column on mobile (now column 4 because IMAP is column 2) */
    .tmcd-user-dashboard .tmcd-domains-table thead th:nth-child(4),
    .tmcd-user-dashboard .tmcd-domains-table tbody td:nth-child(4) {
        display: none;
    }

    .tmcd-user-dashboard .form-actions {
        flex-direction: column;
    }

    .tmcd-user-dashboard .form-actions .button {
        width: 100%;
    }
}
