/**
 * Core Component Styles
 * Extracted from app.php - Reusable UI components (cards, alerts, badges, buttons, modals)
 */

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem var(--theme-card-shadow);
    margin-bottom: 1.5rem;
    background-color: var(--theme-card-bg);
}

.card-header {
    background-color: var(--theme-card-header-bg);
    border-bottom: 1px solid var(--theme-border-color);
    font-weight: 600;
}

/* Alerts */
.alert {
    border: none;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #198754;
    background-color: #d1e7dd;
}

.alert-danger {
    border-left-color: #dc3545;
    background-color: #f8d7da;
}

.alert-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd;
}

.alert-info {
    border-left-color: #0dcaf0;
    background-color: #cff4fc;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: var(--theme-table-hover-bg);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Modal improvements */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem var(--theme-modal-shadow);
    background-color: var(--theme-modal-bg);
    color: var(--theme-text-primary);
    overflow: hidden;
}

.modal-header {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--theme-border-color);
}

/* Modal backdrop blur effect */
.modal-backdrop.show {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* Smooth modal animations */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: scale(0.9) translateY(-20px);
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* ========================================
   Professional Confirmation Modals
   ======================================== */

.confirm-modal .modal-content {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: var(--theme-card-bg, #fff);
}

.confirm-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
}

.confirm-modal .modal-icon {
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.confirm-modal .modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.confirm-modal .modal-body {
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--theme-text-primary, #212529);
    border-left: 4px solid transparent;
}

.confirm-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--theme-border-color, #dee2e6);
    gap: 0.5rem;
    background: var(--theme-bg-tertiary, #f8f9fa);
}

.confirm-modal .modal-footer .btn {
    min-width: 100px;
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1.25rem;
}

/* Danger - Red */
.confirm-modal.modal-danger .modal-header {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    color: white;
}

.confirm-modal.modal-danger .modal-body {
    border-left-color: #dc3545;
}

.confirm-modal.modal-danger .modal-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

/* Warning - Yellow */
.confirm-modal.modal-warning .modal-header {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.confirm-modal.modal-warning .modal-body {
    border-left-color: #ffc107;
}

.confirm-modal.modal-warning .modal-icon {
    background: rgba(0, 0, 0, 0.1);
}

/* Success - Green */
.confirm-modal.modal-success .modal-header {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    color: white;
}

.confirm-modal.modal-success .modal-body {
    border-left-color: #198754;
}

/* Info - Blue */
.confirm-modal.modal-info .modal-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
}

.confirm-modal.modal-info .modal-body {
    border-left-color: #0d6efd;
}

.confirm-modal.modal-info .modal-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* Icon pulse animation for danger modals */
@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Alert modal (showAlert) - single OK button */
.alert-modal .modal-footer {
    justify-content: center;
}

.alert-modal .modal-footer .btn {
    min-width: 120px;
}

/* Persistent banner alerts */
.alert-permanent {
    border-radius: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ---------------------------------------------------------------------------
   Shared progress cell
   Used by src/Views/partials/progress_cell.php and .twig — the stacked
   Submitted / Assessed / IQA-EQA bars on /assessments and the student profile
   Progress tab. Segment widths stay as inline style attributes (they are data,
   not design); everything static lives here.
   --------------------------------------------------------------------------- */
.progress-cell-label {
    font-size: 10px;
    color: var(--theme-text-muted, #6c757d);
    margin-bottom: 2px;
}

.progress-cell-track {
    background: var(--theme-bg-tertiary, #e9ecef);
    border-radius: 3px;
    height: 8px;
    width: 100%;
    overflow: hidden;
    display: flex;
}

.progress-cell-seg {
    height: 100%;
}

/* Keeps the EQA half visually distinct from the IQA half beside it. */
.progress-cell-seg-eqa {
    margin-left: 2px;
}
