/* Dashboard Styles - Clean and Efficient */

:root {
    --primary: #C90C0F;
    --primary-light: #fef2f2;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Main Container */
.dashboard-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem 6rem 2rem;
    min-height: 90vh;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-title {
    font-family: 'DIN Condensed', sans-serif;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.dashboard-title i {
    margin-right: 1rem;
    font-size: 2.2rem;
}

.dashboard-subtitle {
    font-family: 'Rockwell', serif;
    font-size: 1.2rem;
    color: var(--gray);
}

/* Superuser Actions */
.superuser-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-family: 'DIN Condensed', sans-serif;
    font-weight: bold;
    font-size: 1rem;
    border: 2px solid var(--primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.superuser-btn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.superuser-btn i {
    font-size: 1.1rem;
    color: white !important;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    min-height: 70vh;
}

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

/* Dashboard Cards */
.dashboard-card {
    background: var(--white);
    border: 3px solid var(--primary);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Card Header */
.card-header {
    background: var(--primary);
    color: var(--white);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-family: 'DIN Condensed', sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0;
    color: var(--white) !important;
}

.card-icon {
    font-size: 1.5rem;
    opacity: 0.9;
}

/* Card Body */
.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sections */
.section {
    margin-bottom: 2rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'DIN Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--dark);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.refresh-info {
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background: var(--light-gray);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.stat-card.low-credits {
    border-color: #f59e0b;
    background: #fffbeb;
    animation: pulse-warning 2s ease-in-out infinite;
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-family: 'DIN Condensed', sans-serif;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-family: 'Rockwell', serif;
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
}

/* Resource Lists */
.resource-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.resource-list::-webkit-scrollbar {
    width: 6px;
}

.resource-list::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

.resource-list::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 3px;
}

.resource-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Limited resource list - shows 3 items with scrolling */
.resource-list-limited {
    max-height: 400px;
    overflow-y: auto;
}

.resource-item {
    background: var(--light-gray);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.resource-item:last-child {
    margin-bottom: 0;
}

.resource-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.resource-content {
    flex: 1;
    min-width: 0;
}

.resource-title {
    font-family: 'DIN Condensed', sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.resource-meta {
    font-family: 'Rockwell', serif;
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.activity-badge {
    display: inline-block;
    margin-left: 0.5rem;
}

.activity-badge i {
    font-size: 0.8rem;
    color: var(--primary);
    margin-right: 0.2rem;
}

.homework-status {
    margin-top: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-family: 'Rockwell', serif;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.normal {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.urgent {
    background: #fef3c7;
    color: #92400e;
}

.resource-rating {
    margin-top: 0.5rem;
}

.stars {
    display: inline-block;
    margin-right: 0.5rem;
}

.stars i {
    color: #fbbf24;
    font-size: 0.9rem;
    margin-right: 0.1rem;
}

.rating-text {
    font-family: 'Rockwell', serif;
    font-size: 0.8rem;
    color: var(--gray);
}

/* User's Own Rating */
.user-rating {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
}

.user-rating-label {
    font-family: 'Rockwell', serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-stars {
    display: flex;
    gap: 0.1rem;
}

.user-stars i {
    color: var(--primary);
    font-size: 0.85rem;
}

/* User-rated button styling */
.rate-btn.user-rated {
    background: var(--primary) !important;
    color: white !important;
}

.rate-btn.user-rated:hover {
    background: #a00a0c !important;
}

/* Resource Actions */
.resource-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Homework Card & Resource Card - Stack layout with buttons underneath */
.homework-card,
.resource-card {
    display: block !important;
}

.homework-card .homework-actions,
.resource-card .resource-card-actions {
    margin-left: 0;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    background: var(--primary);
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-btn:hover {
    border-color: var(--primary);
    background: #b91c1c;
    color: white !important;
    transform: scale(1.05);
}

.action-btn i {
    font-size: 0.9rem;
    color: white !important;
}

/* Card Footer */
.card-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--border);
    text-align: center;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Rockwell', serif;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.expand-btn:hover {
    color: var(--dark);
}

.expand-btn i {
    font-size: 0.9rem;
}

/* No Data State */
.no-data {
    font-family: 'Rockwell', serif;
    font-size: 1rem;
    color: var(--gray);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 15% auto;
    padding: 0;
    border: 3px solid var(--primary);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.modal-header {
    background: var(--primary);
    color: var(--white);
    padding: 1.5rem;
    border-radius: 13px 13px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: 'DIN Condensed', sans-serif;
    font-size: 1.3rem;
    margin: 0;
    color: var(--white) !important;
}

.close {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-body p {
    font-family: 'Rockwell', serif;
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.rating-stars i {
    font-size: 2rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rating-stars i:hover,
.rating-stars i.fas {
    color: #fbbf24;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border);
    text-align: center;
}

.btn {
    font-family: 'DIN Condensed', sans-serif;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: white !important;
    border: 2px solid var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
    color: white !important;
}

.btn-primary i {
    color: white !important;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .dashboard-grid .full-width {
        grid-column: 1 / -1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 0 1rem 6rem 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .dashboard-title {
        font-size: 2rem;
    }
    
    .dashboard-title i {
        font-size: 1.8rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .resource-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .resource-actions {
        margin-left: 0;
        margin-top: 1rem;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}
