/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.header h1 i {
    margin-right: 0.5rem;
    color: #ffd700;
}

.header-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

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

/* Progress Circle */
.progress-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(#4caf50 0deg, rgba(255, 255, 255, 0.2) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.progress-circle::before {
    content: '';
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    position: absolute;
}

.progress-circle span {
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    z-index: 1;
}

/* Navigation Tabs */
.nav-tabs {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-tabs .container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    font-weight: 600;
}

.tab-btn i {
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card Styles */
.card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Stats Card */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon.pending {
    background: linear-gradient(135deg, #ffc107, #ff8f00);
}

.stat-icon.overdue {
    background: linear-gradient(135deg, #dc3545, #b71c1c);
}

.stat-icon.today {
    background: linear-gradient(135deg, #17a2b8, #0d7377);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.stat-text {
    font-size: 0.8rem;
    color: #666;
}

/* Progress Bar */
.progress-bar-container {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #81c784);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    display: block;
}

/* Task Controls */
.task-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-filter-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
}

.search-box {
    position: relative;
    max-width: 300px;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 45px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    background: white;
    min-width: 120px;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

/* Task Card */
.task-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.task-card.completed {
    opacity: 0.7;
    border-left-color: #28a745;
}

.task-card.overdue {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.task-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.task-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high {
    background: #ffebee;
    color: #c62828;
}

.priority-medium {
    background: #fff3e0;
    color: #ef6c00;
}

.priority-low {
    background: #e8f5e8;
    color: #2e7d32;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.task-subject {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.task-due-date {
    font-size: 0.9rem;
    color: #666;
}

.task-due-date.overdue {
    color: #dc3545;
    font-weight: 600;
}

.task-due-date.today {
    color: #ffc107;
    font-weight: 600;
}

.task-description {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.5;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.task-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Calendar Styles */
.calendar-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.calendar-header h2 {
    color: #667eea;
    font-size: 1.5rem;
}

.calendar-nav {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.calendar-nav:hover {
    background: #5a6fd8;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.calendar-weekdays {
    display: contents;
}

.weekday {
    background: #667eea;
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

.calendar-days {
    display: contents;
}

.calendar-day {
    background: white;
    min-height: 80px;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.other-month {
    color: #ccc;
    background: #f8f9fa;
}

.calendar-day.today {
    background: #fff3cd;
    font-weight: bold;
}

.calendar-day.has-tasks {
    background: #e3f2fd;
}

.day-number {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.day-tasks {
    font-size: 0.7rem;
    color: #667eea;
}

/* Goals Section */
.goals-container {
    display: grid;
    gap: 1.5rem;
}

.goal-form {
    display: flex;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.goal-progress {
    margin-top: 1rem;
}

.goal-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.goal-label {
    font-weight: 600;
}

.goal-value {
    color: #667eea;
    font-weight: bold;
}

.goal-target {
    color: #666;
}

.goal-progress-bar {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 15px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Achievements */
.achievements-list {
    display: grid;
    gap: 1rem;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.achievement.unlocked {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
}

.achievement-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.achievement.unlocked .achievement-icon {
    background: #ffc107;
    color: #333;
}

.achievement-info {
    flex: 1;
}

.achievement-info h4 {
    margin-bottom: 0.25rem;
    color: #333;
}

.achievement-info p {
    color: #666;
    font-size: 0.9rem;
}

.achievement-status {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-status.pending {
    background: #ccc;
    color: white;
}

.achievement-status.unlocked {
    background: #28a745;
    color: white;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    color: #667eea;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close-modal:hover {
    color: #333;
}

/* Form Styles */
form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #28a745;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

.toast.info {
    border-left-color: #17a2b8;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Upcoming Tasks List */
.upcoming-list,
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.upcoming-task,
.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.upcoming-task:last-child,
.activity-item:last-child {
    border-bottom: none;
}

.task-info {
    flex: 1;
}

.task-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.task-subject-small {
    font-size: 0.8rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    display: inline-block;
}

.due-info {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.due-info.overdue {
    background: #ffebee;
    color: #c62828;
}

.due-info.today {
    background: #fff3e0;
    color: #ef6c00;
}

.due-info.upcoming {
    background: #e3f2fd;
    color: #1976d2;
}

.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-stats {
        justify-content: center;
        gap: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .task-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-filter-section {
        justify-content: center;
    }

    .filter-controls {
        justify-content: center;
    }

    .task-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .task-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-actions {
        justify-content: center;
    }

    .form-row {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 2% auto;
    }

    .nav-tabs .container {
        justify-content: center;
    }

    .goal-form {
        flex-direction: column;
    }

    .calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }

    .weekday {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        font-size: 0.8rem;
    }

    .calendar-day {
        min-height: 50px;
    }

    .task-card {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}