/* ========================================
   MELT Timesheet App - Component Styles
   Cards, Modules, Timesheets, Status Badges
   ======================================== */

/* ========================================
   CARDS - Base Styles
   ======================================== */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--gray-100);
    background: linear-gradient(180deg, var(--gray-50) 0%, white 100%);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-title-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-500);
}

.card-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.card-body {
    padding: var(--spacing-xl);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* ========================================
   STATUS BADGES
   ======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-pending {
    background: var(--gray-100);
    color: var(--gray-600);
}

.status-in-progress {
    background: var(--info-100);
    color: var(--info-600);
}

.status-completed {
    background: var(--success-100);
    color: var(--success-600);
}

.status-signed {
    background: var(--primary-100);
    color: var(--primary-700);
}

.status-verified {
    background: linear-gradient(135deg, var(--success-100) 0%, var(--primary-100) 100%);
    color: var(--success-700);
}

/* ========================================
   PROGRESS INDICATORS
   ======================================== */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar.success {
    background: linear-gradient(90deg, var(--success-500) 0%, var(--success-600) 100%);
}

.progress-bar.warning {
    background: linear-gradient(90deg, var(--warning-500) 0%, var(--warning-600) 100%);
}

.progress-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-sm);
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.progress-percentage {
    font-weight: 700;
    color: var(--primary-700);
}

/* ========================================
   MODULE CARDS
   ======================================== */
.module-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
}

.module-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
}

.module-card-header.yard-demo {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.module-card-header.yard-practice {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.module-card-header.in-cab {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.module-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 700;
    margin-right: var(--spacing-md);
}

.module-info {
    flex: 1;
}

.module-name {
    font-size: 1.125rem;
    font-weight: 700;
}

.module-meta {
    font-size: 0.8125rem;
    opacity: 0.85;
    margin-top: 2px;
}

.module-hours-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.module-hours-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.module-hours-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.module-card-body {
    padding: 0;
}

/* ========================================
   ACTIVITY ROWS
   ======================================== */
.activity-list {
    list-style: none;
}

.activity-row {
    display: grid;
    grid-template-columns: 2fr 100px 1fr 1fr 100px 100px 100px auto;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md) var(--spacing-xl);
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition-fast);
}

.activity-row:hover {
    background: var(--gray-50);
}

.activity-row:last-child {
    border-bottom: none;
}

.activity-row.extra-row {
    border-top: none;
    padding-top: var(--spacing-sm);
    background: transparent;
}

.activity-row.extra-row:hover {
    background: transparent; /* visually group with parent */
}

.activity-name {
    font-weight: 500;
    color: var(--gray-800);
}

.activity-name small {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 400;
}

.activity-hours-required {
    text-align: center;
    font-weight: 600;
    color: var(--primary-700);
    background: var(--primary-50);
    padding: 4px 8px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.activity-input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-align: center;
    transition: all var(--transition-fast);
}

.activity-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.activity-input[type="date"] {
    min-width: 130px;
}

.activity-input[type="time"] {
    min-width: 100px;
}

.activity-hours-actual {
    text-align: center;
    font-weight: 700;
    color: var(--success-600);
    font-size: 0.9375rem;
}

.activity-hours-actual.incomplete {
    color: var(--warning-600);
}

.signature-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.signature-btn:hover {
    border-color: var(--primary-400);
    color: var(--primary-600);
    background: var(--primary-50);
}

.signature-btn.signed {
    border: 1px solid var(--success-400);
    background: var(--success-50);
    color: var(--success-700);
    border-style: solid;
}

.signature-btn svg {
    width: 14px;
    height: 14px;
}

.activity-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Activity Row Header */
.activity-header {
    display: grid;
    grid-template-columns: 2fr 100px 1fr 1fr 100px 100px 100px auto;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: 600;
}

/* ========================================
   DASHBOARD STATS CARDS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-500);
}

.stat-card.success::before {
    background: var(--success-500);
}

.stat-card.warning::before {
    background: var(--warning-500);
}

.stat-card.info::before {
    background: var(--info-500);
}

.stat-card.danger::before {
    background: var(--danger-500);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    background: var(--primary-100);
    color: var(--primary-600);
}

.stat-card.success .stat-icon {
    background: var(--success-100);
    color: var(--success-600);
}

.stat-card.warning .stat-icon {
    background: var(--warning-100);
    color: var(--warning-600);
}

.stat-card.info .stat-icon {
    background: var(--info-100);
    color: var(--info-600);
}

.stat-card.danger .stat-icon {
    background: var(--danger-100);
    color: var(--danger-600);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ========================================
   STUDENT PROFILE CARD
   ======================================== */
.student-profile-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.student-profile-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: white;
}

.student-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin-right: var(--spacing-xl);
}

.student-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.student-info p {
    opacity: 0.85;
    font-size: 0.9375rem;
}

.student-profile-body {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
}

.profile-field {
    display: flex;
    flex-direction: column;
}

.profile-field-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.profile-field-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* ========================================
   CATEGORY TABS
   ======================================== */
.category-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-sm);
    background: var(--gray-100);
    border-radius: var(--radius-lg);
}

.category-tab {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.category-tab:hover {
    background: white;
    color: var(--gray-800);
}

.category-tab.active {
    background: white;
    color: var(--primary-700);
    box-shadow: var(--shadow-sm);
}

.category-tab svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   ALERTS
   ======================================== */
.alert-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
}

.alert-card.warning {
    background: var(--warning-50);
    border: 1px solid var(--warning-500);
}

.alert-card.success {
    background: var(--success-50);
    border: 1px solid var(--success-500);
}

.alert-card.info {
    background: var(--info-50);
    border: 1px solid var(--info-500);
}

.alert-card.danger {
    background: var(--danger-50);
    border: 1px solid var(--danger-500);
}

.alert-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alert-card.warning .alert-icon {
    color: var(--warning-600);
}

.alert-card.success .alert-icon {
    color: var(--success-600);
}

.alert-card.info .alert-icon {
    color: var(--info-600);
}

.alert-card.danger .alert-icon {
    color: var(--danger-600);
}

.alert-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-card.warning .alert-content h4 {
    color: var(--warning-700);
}

.alert-card.success .alert-content h4 {
    color: var(--success-700);
}

.alert-card.info .alert-content h4 {
    color: var(--info-700);
}

.alert-card.danger .alert-content h4 {
    color: var(--danger-700);
}

.alert-content p {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

/* ========================================
   STUDENT LIST
   ======================================== */
.student-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.student-list-item {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.student-list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
}

.student-list-item.selected {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.student-list-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.student-list-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
}

.student-list-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.student-list-license {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.student-list-progress {
    margin-top: var(--spacing-md);
}

.student-list-stats {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-100);
}

.student-list-stat {
    text-align: center;
}

.student-list-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.student-list-stat-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    color: var(--gray-500);
}

/* ========================================
   SECTION HEADERS
   ======================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--gray-500);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: var(--gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

/* ========================================
   CERTIFICATION BANNER
   ======================================== */
.certification-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    border-radius: var(--radius-xl);
    color: white;
    margin-bottom: var(--spacing-xl);
}

.certification-banner.not-eligible {
    background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-600) 100%);
}

.certification-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.certification-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.certification-icon svg {
    width: 28px;
    height: 28px;
}

.certification-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.certification-text p {
    font-size: 0.9375rem;
    opacity: 0.9;
}