* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    animation: backgroundShift 15s ease infinite;
}

@keyframes backgroundShift {
    0%, 100% { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
    50% { background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-color);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeInUp 0.6s ease;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

@keyframes headerPulse {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10%, 10%) scale(1.1); }
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    animation: titleBounce 1s ease;
}

@keyframes titleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    animation: fadeIn 1.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.95; }
}

/* Field Selector */
.field-selector {
    padding: 20px 30px;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.field-selector label {
    font-weight: 600;
    color: var(--text-primary);
}

.field-selector select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.field-selector select:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.field-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

/* Statistics Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    animation: statCardFloat 3s ease-in-out infinite;
}

@keyframes statCardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.3s; }
.stat-card:nth-child(3) { animation-delay: 0.6s; }
.stat-card:nth-child(4) { animation-delay: 0.9s; }

.stat-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    font-weight: 700;
    animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stat-card p {
    font-size: 0.9rem;
    opacity: 0.95;
}

/* Add Task Section */
.add-task-section {
    padding: 30px;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
}

.add-task-section h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
}

#taskForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.form-group input,
.form-group select,
.form-group textarea {
    transition: all 0.3s ease;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #94a3b8;
}

.form-group textarea {
    resize: vertical;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before,
.btn-danger::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-danger:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-primary);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

/* Filter Section */
.filter-section {
    padding: 30px;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
}

.filter-section h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    flex: 1;
    min-width: 150px;
}

/* Tasks Section */
.tasks-section {
    padding: 30px;
}

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

.tasks-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Task Card */
.task-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    gap: 15px;
    align-items: start;
    animation: slideInLeft 0.5s ease;
    position: relative;
    overflow: hidden;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.task-card:hover::before {
    left: 100%;
}

.task-card:hover {
    transform: translateX(5px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.task-card.completed {
    opacity: 0.7;
    background: #f1f5f9;
    animation: completePulse 0.5s ease;
}

@keyframes completePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.98); }
}

.task-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin-top: 5px;
    transition: transform 0.3s ease;
}

.task-checkbox:hover {
    transform: scale(1.2);
}

.task-checkbox:checked {
    animation: checkboxBounce 0.3s ease;
}

@keyframes checkboxBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.task-content {
    flex: 1;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
    gap: 15px;
}

.task-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: default;
}

.badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.badge-priority-Low {
    background: #d1fae5;
    color: #065f46;
}

.badge-priority-Medium {
    background: #fef3c7;
    color: #92400e;
}

.badge-priority-High {
    background: #fed7aa;
    color: #9a3412;
}

.badge-priority-Urgent {
    background: #fecaca;
    color: #991b1b;
}

.task-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.task-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.task-actions {
    display: flex;
    gap: 8px;
}

.btn-edit,
.btn-delete {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-edit::after,
.btn-delete::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-edit:hover::after,
.btn-delete:hover::after {
    width: 200px;
    height: 200px;
}

.btn-edit {
    background: #3b82f6;
    color: white;
}

.btn-edit:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.task-field {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}

/* Feedback Section */
.feedback-section {
    padding: 30px;
    background: var(--bg-color);
}

.feedback-section > h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}

.feedback-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.feedback-form-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.feedback-form-container:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.feedback-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.feedback-header h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.feedback-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Feedback History */
.feedback-history-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    margin-top: 30px;
}

.feedback-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.feedback-history-header h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
}

.history-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.history-filters select {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
}

.feedback-history {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.feedback-item {
    background: #f8fafc;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.feedback-item:hover {
    transform: translateX(8px) scale(1.01);
    box-shadow: var(--shadow);
}

.feedback-item.student {
    border-left-color: #3b82f6;
}

.feedback-item.counselor {
    border-left-color: #8b5cf6;
}

.feedback-item.parent {
    border-left-color: #10b981;
}

.feedback-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
    gap: 15px;
    flex-wrap: wrap;
}

.feedback-item-info h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.feedback-item-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.feedback-type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.feedback-type-badge.student {
    background: #dbeafe;
    color: #1e40af;
}

.feedback-type-badge.counselor {
    background: #ede9fe;
    color: #5b21b6;
}

.feedback-type-badge.parent {
    background: #d1fae5;
    color: #065f46;
}

.feedback-item-content {
    color: var(--text-primary);
    line-height: 1.6;
    margin-top: 10px;
}

.feedback-additional-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-delete-feedback {
    padding: 6px 12px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-delete-feedback:hover {
    background: #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filter-controls {
        flex-direction: column;
    }

    .filter-controls select {
        width: 100%;
    }

    .tasks-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .task-header {
        flex-direction: column;
    }

    .task-actions {
        width: 100%;
    }

    .btn-edit,
    .btn-delete {
        flex: 1;
    }

    .feedback-history-header {
        flex-direction: column;
        align-items: stretch;
    }

    .history-filters {
        flex-direction: column;
    }

    .history-filters select,
    .history-filters button {
        width: 100%;
    }

    .feedback-item-header {
        flex-direction: column;
    }
}
