/**
 * Student Portal Styles
 * Extracted from class-student-portal.php for better maintainability
 * 
 * @package Shumokh_Edu
 * @since 1.0.0
 */

/* Root Variables */
:root {
    --shumokh-blue: #1e3a8a;
    --shumokh-gold: #d97706;
    --shumokh-green: #059669;
    --shumokh-red: #dc2626;
    --shumokh-gray: #f3f4f6;
    --shumokh-text: #1f2937;
    --shumokh-muted: #6b7280;
}

/* Portal Container */
.shumokh-student-portal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Portal Header */
.portal-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

/* Track Switcher Tabs */
.shumokh-track-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
    overflow-x: auto;
}

.track-tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f3f4f6;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.track-tab:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.track-tab.active {
    background: var(--shumokh-blue);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

.portal-welcome h2 {
    margin: 0 0 5px;
}

.portal-track {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Portal Grid Layout */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Portal Widget */
.portal-widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.portal-widget h3 {
    margin: 0 0 15px;
    font-size: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.portal-widget.full-width {
    grid-column: 1 / -1;
}

/* Next Lesson Widget */
.next-lesson-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.lesson-subject {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.lesson-teacher {
    color: #666;
    margin-bottom: 10px;
}

.lesson-datetime {
    display: flex;
    gap: 15px;
}

.lesson-date,
.lesson-time {
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.countdown-timer {
    text-align: center;
}

.countdown-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.countdown-value {
    font-size: 28px;
    font-weight: 700;
    color: #0073aa;
    font-family: monospace;
}

.join-now-btn {
    animation: pulse 2s infinite;
    font-size: 18px !important;
    padding: 15px 30px !important;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.no-lesson {
    text-align: center;
    padding: 30px;
}

.no-lesson-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Bookings Widget */
.bookings-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.booking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.booking-subject {
    font-weight: 500;
    display: block;
}

.booking-date {
    font-size: 12px;
    color: #888;
}

.booking-status {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    background: #e0e0e0;
}

.status-approved .booking-status {
    background: #d4edda;
    color: #155724;
}

.status-pending .booking-status {
    background: #fff3cd;
    color: #856404;
}

.status-completed .booking-status {
    background: #cce5ff;
    color: #004085;
}

.view-all-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #0073aa;
    text-decoration: none;
}

/* Actions Widget */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.action-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.action-label {
    font-size: 13px;
    font-weight: 500;
}

/* Recordings Widget */
.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.recording-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.recording-thumb {
    height: 120px;
    background: #ddd;
}

.recording-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recording-info {
    padding: 10px;
}

.recording-info h4 {
    margin: 0 0 5px;
    font-size: 14px;
}

.recording-date {
    font-size: 12px;
    color: #666;
}

.recording-card .button {
    display: block;
    margin: 0 10px 10px;
    text-align: center;
}

/* Package Grid (Saudi Package Widget) */
.shumokh-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Stat Cards */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

/* Icon Styling */
.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.status-primary .stat-icon-wrapper {
    background: #eff6ff;
    color: var(--shumokh-blue);
}

.status-warning .stat-icon-wrapper {
    background: #fffbeb;
    color: var(--shumokh-gold);
}

.status-danger .stat-icon-wrapper {
    background: #fef2f2;
    color: var(--shumokh-red);
}

.status-success .stat-icon-wrapper {
    background: #ecfdf5;
    color: var(--shumokh-green);
}

.status-neutral .stat-icon-wrapper {
    background: #f3f4f6;
    color: var(--shumokh-muted);
}

.status-info .stat-icon-wrapper {
    background: #f0f9ff;
    color: #0ea5e9;
}

.status-accent .stat-icon-wrapper {
    background: #fff7ed;
    color: #ea580c;
}

.status-action .stat-icon-wrapper {
    background: #eff6ff;
    color: var(--shumokh-blue);
}

/* Content Typography */
.stat-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--shumokh-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value-group {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--shumokh-text);
    line-height: 1.2;
}

.stat-unit {
    font-size: 13px;
    color: var(--shumokh-muted);
    font-weight: 500;
}

.stat-meta {
    font-size: 13px;
    color: var(--shumokh-muted);
    margin-top: 4px;
}

.stat-meta.highlight {
    color: var(--shumokh-blue);
    font-weight: 600;
}

.text-muted {
    color: #9ca3af;
}

.status-text-success {
    color: var(--shumokh-green);
}

.status-text-muted {
    color: var(--shumokh-muted);
}

/* Action Card Specifics */
a.stat-card {
    text-decoration: none;
}

.action-link {
    color: var(--shumokh-blue);
}

.card-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--shumokh-blue);
    opacity: 0;
    transition: opacity 0.2s, right 0.2s;
}

.stat-card:hover .card-arrow {
    opacity: 1;
    right: 15px;
}

/* No Data Message */
.no-data {
    color: #999;
    text-align: center;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }

    .next-lesson-content {
        flex-direction: column;
        text-align: center;
    }

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .shumokh-package-grid {
        grid-template-columns: 1fr;
    }
}

/* Hour Package Widget (باقتي) */
.hour-package-widget {
    border-right: 4px solid #7c5cbf;
}

.package-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.package-info-grid .info-item {
    text-align: center;
}

.package-info-grid .info-label {
    display: block;
    font-size: 11px;
    color: var(--shumokh-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.package-info-grid .info-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--shumokh-text, #1f2937);
}

.package-info-grid .info-value.highlight {
    color: #7c5cbf;
}

.package-progress {
    background: #f3f4f6;
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
}

.package-progress .progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #7c5cbf, #9b59b6);
    border-radius: 8px;
    transition: width 0.4s ease;
}

@media (max-width: 480px) {
    .package-info-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Post-Session Rebooking Widget */
.shumokh-post-session-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: shumokh-fade-in 0.3s ease-out;
}

.shumokh-post-session-card {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: shumokh-scale-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.post-session-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
    position: relative;
}

.header-emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    animation: shumokh-bounce 1s infinite;
}

.post-session-header h2 {
    margin: 0 0 5px;
    font-size: 24px;
    color: #fff;
}

.post-session-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.post-session-teacher-info {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #eee;
    background: #f9fafb;
}

.teacher-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.teacher-details .label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.teacher-details .teacher-name {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.post-session-content {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    /* limits height on tall screens */
}

.post-session-content.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #6b7280;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.post-session-actions {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fff;
    text-align: center;
}

.btn-dismiss-overlay {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 10px;
    width: 100%;
}

.btn-dismiss-overlay:hover {
    color: #374151;
}

/* Animations */
@keyframes shumokh-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shumokh-scale-in {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shumokh-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Slot Grid Styles */
.rebook-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.slot-btn {
    padding: 10px 5px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: all 0.2s;
}

.slot-btn.selected {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.slot-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.rebook-date-group h4 {
    font-size: 14px;
    color: #6b7280;
    margin: 15px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f3f4f6;
}

.btn-book-session {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-book-session:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn-buy-package {
    display: inline-block;
    padding: 12px 24px;
    background: #10b981;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 10px;
}

/* Student chat widget parity with teacher portal */
.chat-widget-content p {
    margin: 0 0 10px;
    color: #444;
}

.chat-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.chat-active-label {
    color: #2e7d32;
    font-size: 13px;
}

.chat-panel-note {
    color: #666;
    margin: 0 0 12px;
}