/* Student Progress Hub - Template-Inspired Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    min-height: 100vh;
    color: #1f2937;
}

.student-hub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.hub-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    color: white;
    position: relative;
    overflow: hidden;
}

.hub-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.student-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.student-info h1 {
    font-size: 2.4rem;
    margin: 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.student-grade {
    font-size: 1.1rem;
    margin: 3px 0;
    opacity: 0.9;
    font-weight: 500;
}

.user-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    z-index: 3;
}

.user-indicator.editing {
    background: rgba(251, 191, 36, 0.8);
    color: #92400e;
    font-weight: 600;
}

.user-indicator.student {
    background: rgba(59, 130, 246, 0.8);
    color: #1e40af;
    font-weight: 600;
}

.week-info {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 2;
}

.week-title {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 6px;
    text-align: center;
}

.week-subtitle {
    text-align: center;
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 12px;
}

.week-dates {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.date-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.3);
}

.header-progress {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.header-stat {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}

.header-stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.header-stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.header-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
}

.header-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    width: 0%;
    transition: width 0.5s ease;
}

/* Admin Controls */
.admin-controls {
    padding: 20px 30px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    border-radius: 15px;
    margin-bottom: 20px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

/* Week Grid */
.week-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.friday {
    grid-column: 1 / -1;
}

/* Day Cards */
.day-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-top: 6px solid;
    position: relative;
    overflow: hidden;
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1));
    transform: rotate(45deg) translate(30px, -30px);
}

.monday { border-top-color: #dc2626; }
.tuesday { border-top-color: #ea580c; }
.wednesday { border-top-color: #d97706; }
.thursday { border-top-color: #ca8a04; }
.friday { border-top-color: #16a34a; }

.day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px 15px 25px;
    cursor: pointer;
    user-select: none;
}

.day-header:hover {
    background: rgba(0,0,0,0.02);
}

.day-title-section {
    display: flex;
    align-items: center;
}

.day-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-left: 10px;
}

.monday .day-title { color: #dc2626; }
.tuesday .day-title { color: #ea580c; }
.wednesday .day-title { color: #d97706; }
.thursday .day-title { color: #ca8a04; }
.friday .day-title { color: #16a34a; }

.jummah-label {
    font-size: 0.9rem;
    color: #16a34a;
    font-weight: 600;
    margin-left: 10px;
    background: rgba(16, 163, 74, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: transform 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toggle-btn:hover {
    background: rgba(0,0,0,0.05);
}

.toggle-btn.collapsed {
    transform: rotate(-90deg);
}

.day-content {
    padding: 0 25px 25px 25px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.day-content.collapsed {
    max-height: 0;
    padding: 0 25px;
}

/* Character Development */
.character-development {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.9), rgba(245, 158, 11, 0.9));
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
}

.character-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.character-title {
    font-size: 1.1rem !important;
    font-weight: bold !important;
    color: #92400e !important;
    margin: 0 !important;
}

.character-subtitle {
    color: #a16207 !important;
    font-size: 0.85rem !important;
    margin-bottom: 10px !important;
    font-weight: 500 !important;
}

.character-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #92400e;
    transition: transform 0.3s ease;
}

.character-toggle.collapsed {
    transform: rotate(-90deg);
}

.character-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.character-content.collapsed {
    max-height: 0;
    padding: 0;
}

.character-completion-task {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.character-completion-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #92400e;
}

.challenge-box {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.challenge-box strong {
    color: #92400e;
}

.quran-verse {
    background: rgba(16, 185, 129, 0.15);
    border-left: 3px solid #10b981;
    border-radius: 6px;
    padding: 10px;
    margin: 10px 0;
    font-style: italic;
    color: #047857;
    text-align: center;
    font-size: 0.85rem;
}

/* Appointment Styles */
.appointment {
    background: linear-gradient(135deg, #e0f2fe, #b3e5fc);
    border: 1px solid #4fc3f7;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    color: #01579b;
    font-weight: 600;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.2);
}

.special-appointment {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px dashed #f59e0b;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    color: #92400e;
    font-weight: 600;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.appointment-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.appointment-content::before {
    content: "🕒";
    margin-right: 8px;
    font-size: 1rem;
}

.appointment-title {
    margin-bottom: 4px !important;
}

.special-appointment-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.special-appointment-content::before {
    content: "👁️";
    margin-right: 8px;
    font-size: 1.2rem;
}

.tutor-photo {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    border: 3px solid #4fc3f7 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    margin-left: auto !important;
    object-fit: cover !important;
}

/* Reading Tasks */
.book-reading {
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    border-left: 3px solid #7c3aed;
    font-size: 0.9rem;
}

.book-cover {
    width: 70px !important;
    height: auto !important;
    float: left;
    margin-right: 15px !important;
    margin-bottom: 15px !important;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.reading-completion-section {
    clear: both;
    margin-top: 20px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* Task Items */
.task-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.task-item:hover {
    background: #f1f5f9;
    transform: translateX(3px);
}

.task-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.task-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.task-checkbox.clickable {
    cursor: pointer;
}

.task-content {
    flex-grow: 1;
}

.task-name {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.task-time {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 1px;
}

.platform-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-left: 8px;
    border-radius: 4px;
}

/* Blog Post Special Styling - CORRECTED */
.blog-post-item {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.blog-post-item .platform-logo {
    width: 60px !important;
    height: 60px !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
    object-fit: contain !important;
    align-self: center !important;
    order: 1 !important;
}

.blog-post-item .task-content {
    order: 0 !important;
    flex: 1 !important;
}

.blog-post-item .task-checkbox {
    order: -1 !important;
}

.blog-post-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #0284c7, #0ea5e9);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.blog-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.25);
}

.blog-post-item .task-content {
    flex: 1;
    min-width: 0;
}

.blog-post-item .task-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0c4a6e;
}

.blog-post-item .task-time {
    color: #075985;
    font-weight: 500;
}

.blog-logo-right {
    width: 50px !important;
    height: 50px !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    background: white !important;
    padding: 4px !important;
    object-fit: contain !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

/* Coursework Reminder */
.coursework-reminder {
    background: linear-gradient(135deg, #fff7ed, #fed7aa);
    border-left: 4px solid #ea580c;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px 0;
    font-size: 0.85rem;
}

.coursework-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #9a3412;
    margin-bottom: 8px;
}

.coursework-text {
    color: #9a3412;
    font-weight: 500;
    line-height: 1.4;
}

/* Prayer Section */
.prayer-section {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 8px;
    padding: 12px;
    margin: 20px 0 5px 0;
    border-left: 3px solid #16a34a;
}

.prayer-title {
    font-weight: bold;
    color: #15803d;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.prayer-quote {
    font-style: italic;
    color: #047857;
    font-size: 0.75rem;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.prayer-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
}

.prayer-checkbox {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    cursor: pointer;
    accent-color: #16a34a;
}

.prayer-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.prayer-checkbox.clickable {
    cursor: pointer;
}

/* Chores Section */
.chores-section {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    border-left: 3px solid #ef4444;
}

.chores-title {
    font-weight: bold;
    color: #991b1b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

/* Completed State */
.completed .task-name {
    text-decoration: line-through;
}

.completed .task-time {
    text-decoration: line-through;
}

.completed {
    opacity: 0.6;
}

/* Task Actions */
.task-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 10px;
}

.task-item:hover .task-actions,
.character-development:hover .task-actions,
.appointment:hover .task-actions,
.coursework-reminder:hover .task-actions,
.blog-post-item:hover .task-actions {
    opacity: 1;
}

.edit-task-btn, .delete-task-btn, .edit-chore-btn, .delete-chore-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 14px;
}

.edit-task-btn:hover, .edit-chore-btn:hover {
    background: #e5e7eb;
}

.delete-task-btn:hover, .delete-chore-btn:hover {
    background: #fee2e2;
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-content h3 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 1.5rem;
}

.modal-content select,
.modal-content input[type="text"],
.modal-content input[type="url"],
.modal-content input[type="number"],
.modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.modal-content select:focus,
.modal-content input[type="text"]:focus,
.modal-content input[type="url"]:focus,
.modal-content input[type="number"]:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.modal-actions button[type="submit"] {
    background: #4f46e5;
    color: white;
}

.modal-actions button.cancel {
    background: #e5e7eb;
    color: #374151;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #9ca3af;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #374151;
}

#modal-task-fields {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    background: #f9fafb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .student-hub-container {
        padding: 10px;
    }
    
    .student-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .student-info h1 {
        font-size: 2rem;
    }
    
    .week-grid {
        grid-template-columns: 1fr;
    }

    .prayer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        max-width: 100%;
    }
    
    .prayer-item {
        padding: 8px 4px;
        font-size: 0.75rem;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    
    .prayer-checkbox {
        width: 16px;
        height: 16px;
        margin: 0 0 4px 0;
    }
    
    .prayer-item span {
        text-align: center;
        word-break: keep-all;
    }

    .header-progress {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .header-stat {
        padding: 8px 4px;
        min-width: 0;
    }
    
    .header-stat-number {
        font-size: 1.4rem;
        margin-bottom: 1px;
    }
    
    .header-stat-label {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .task-actions {
        opacity: 1;
        margin-top: 8px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .prayer-quote {
        font-size: 0.7rem;
        white-space: normal;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .prayer-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .prayer-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 10px 12px;
        min-height: 44px;
    }
    
    .prayer-checkbox {
        margin: 0 8px 0 0;
    }

    .header-stat {
        padding: 6px 2px;
    }
    
    .header-stat-number {
        font-size: 1.2rem;
    }
    
    .header-stat-label {
        font-size: 0.65rem;
    }
}