/**
 * Student Performance Dashboard - Enhanced Styles
 * Complete styling with charts, recommendations, and analytics
 */

/* Main Wrapper */
.spd-wrapper {
    background: #f9f9f9;
    padding: 20px;
    max-width: 1400px;
    margin: 20px auto;
}

.spd-main-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #2c3e50;
}

/* Filter Section */
.spd-filter-section {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.spd-filter-row {
    margin-bottom: 15px;
}

.spd-filter-row:last-child {
    margin-bottom: 0;
}

.spd-date-filters {
    display: none;
}

.spd-date-filters input {
    margin-right: 10px;
}

/* Select Dropdowns */
.spd-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background-color: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23333' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.spd-select:hover {
    border-color: #3498db;
    background-color: #fff;
}

.spd-select:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

/* Date Inputs */
.spd-date-input {
    width: calc(50% - 5px);
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background-color: #f8f9fa;
    color: #333;
    transition: all 0.3s ease;
}

.spd-date-input:first-child {
    margin-right: 10px;
}

.spd-date-input:hover {
    border-color: #3498db;
    background-color: #fff;
}

.spd-date-input:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
    background-color: #fff;
}

/* Buttons */
.spd-buttons {
    display: flex;
    gap: 12px;
}

.spd-btn {
    padding: 12px 30px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.spd-btn-primary {
    background-color: #2c3e50;
    color: #ffffff;
}

.spd-btn-primary:hover {
    background-color: #1a252f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.spd-btn-secondary {
    background-color: #34495e;
    color: #ffffff;
}

.spd-btn-secondary:hover {
    background-color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3);
}

/* Stats Label */
.spd-stats-label {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats Grid */
.spd-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    transition: opacity 0.3s ease;
}

/* Stat Card */
.spd-stat-card {
    background: #ffffff;
    padding: 30px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.spd-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.spd-stat-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
    text-transform: capitalize;
}

.spd-stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

/* Readiness Specific */
.spd-readiness-card {
    position: relative;
}

.spd-readiness-desc {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 10px;
    font-weight: 400;
    line-height: 1.4;
}

/* Readiness Colors */
#spd-readiness.spd-excellent {
    color: #27ae60;
}

#spd-readiness.spd-good {
    color: #3498db;
}

#spd-readiness.spd-fair {
    color: #f39c12;
}

#spd-readiness.spd-poor {
    color: #e74c3c;
}

/* Performance Trend Section */
.spd-trend-section {
    margin-bottom: 30px;
}

.spd-trend-indicator {
    background: #ffffff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    font-weight: 500;
}

.spd-trend-icon {
    font-size: 28px;
    line-height: 1;
}

.spd-trend-up {
    background: linear-gradient(135deg, #d4edda 0%, #fff 100%);
    border-left: 4px solid #27ae60;
    color: #155724;
}

.spd-trend-down {
    background: linear-gradient(135deg, #f8d7da 0%, #fff 100%);
    border-left: 4px solid #e74c3c;
    color: #721c24;
}

.spd-trend-stable {
    background: linear-gradient(135deg, #d1ecf1 0%, #fff 100%);
    border-left: 4px solid #3498db;
    color: #0c5460;
}

/* Charts Section */
.spd-charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.spd-chart-container {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.spd-chart-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    margin-top: 0;
}

.spd-chart-container canvas {
    max-height: 300px;
}

.spd-no-data {
    text-align: center;
    color: #7f8c8d;
    padding: 40px 20px;
    font-style: italic;
}

/* Recommendations Section */
.spd-recommendations-section {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.spd-recommendations-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    margin-top: 0;
}

.spd-recommendation-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.spd-recommendation-items li {
    padding: 15px 20px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.spd-recommendation-items li:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.spd-recommendation-items li:last-child {
    margin-bottom: 0;
}

/* Recent Activity Section */
.spd-activity-section {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.spd-activity-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    margin-top: 0;
}

/* Recent Attempts Table */
.spd-attempts-table {
    width: 100%;
}

.spd-attempts-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1.5fr;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 10px;
}

.spd-attempts-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1.5fr;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    transition: background 0.3s ease;
}

.spd-attempts-row:hover {
    background: #f8f9fa;
}

.spd-attempts-row:last-child {
    border-bottom: none;
}

.spd-attempt-course {
    font-weight: 500;
    color: #2c3e50;
}

.spd-attempt-quiz {
    color: #7f8c8d;
}

.spd-attempt-score {
    font-weight: 700;
    font-size: 16px;
}

.spd-score-excellent {
    color: #27ae60;
}

.spd-score-good {
    color: #3498db;
}

.spd-score-fair {
    color: #f39c12;
}

.spd-score-poor {
    color: #e74c3c;
}

.spd-attempt-date {
    color: #95a5a6;
    font-size: 13px;
}

/* Loading Indicator */
.spd-loading {
    text-align: center;
    padding: 40px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.spd-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c3e50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spd-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spd-loading p {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
}

.spd-loading-text {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
    font-style: italic;
}

/* Error Message */
.spd-error-message {
    background-color: #e74c3c;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
    animation: spd-slide-down 0.3s ease;
}

.spd-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
    font-size: 15px;
}

@keyframes spd-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .spd-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .spd-charts-section {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .spd-main-title {
        font-size: 24px;
    }
    
    .spd-filter-section {
        padding: 20px 15px;
    }
    
    .spd-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .spd-stat-card {
        padding: 25px 20px;
    }
    
    .spd-stat-value {
        font-size: 28px;
    }
    
    .spd-date-input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .spd-date-input:first-child {
        margin-right: 0;
    }
    
    .spd-buttons {
        flex-direction: column;
    }
    
    .spd-btn {
        width: 100%;
    }
    
    .spd-attempts-header,
    .spd-attempts-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .spd-attempts-header {
        display: none;
    }
    
    .spd-attempts-row {
        padding: 15px;
        background: #f8f9fa;
        margin-bottom: 10px;
        border-radius: 6px;
        border: none;
    }
    
    .spd-attempt-course::before {
        content: 'Course: ';
        font-weight: 600;
        color: #7f8c8d;
    }
    
    .spd-attempt-quiz::before {
        content: 'Quiz: ';
        font-weight: 600;
        color: #7f8c8d;
    }
    
    .spd-attempt-score::before {
        content: 'Score: ';
        font-weight: 600;
        color: #7f8c8d;
    }
    
    .spd-attempt-date::before {
        content: 'Date: ';
        font-weight: 600;
        color: #7f8c8d;
    }
}

@media screen and (max-width: 480px) {
    .spd-wrapper {
        padding: 15px;
    }
    
    .spd-main-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .spd-stat-title {
        font-size: 16px;
    }
    
    .spd-stat-value {
        font-size: 24px;
    }
    
    .spd-chart-container canvas {
        max-height: 200px;
    }
}

/* Print Styles */
@media print {
    .spd-filter-section,
    .spd-buttons {
        display: none;
    }
    
    .spd-stats-grid,
    .spd-charts-section {
        break-inside: avoid;
    }
    
    .spd-stat-card,
    .spd-chart-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}