 
:root {
    --primary-dark: #1e3c72;
    --primary: #2a5298;
    --accent-pink: #ff9a9e;
    --accent-yellow: #f6d365;
    --success: #4CAF50;
    --success-light: #e8f5e9;
    --warning: #ff9800;
    --warning-light: #fff3e0;
    --danger: #f44336;
    --danger-light: #ffebee;
    --info: #2196F3;
    --info-light: #e3f2fd;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #140707;
    min-height: 100vh;
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: rgb(255, 255, 255);
    min-height: 100vh;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.8s ease;
    --header-text-color: rgb(0, 0, 0);

}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: rgb(255, 255, 255);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2.2rem;
    color: var(--accent-yellow);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #f6d365, #ff9a9e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a9e, #f6d365);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

nav {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 0.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-list {
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 0.5rem;
}

.nav-item {
    margin: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav-link i {
    font-size: 1.2rem;
    color: white;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-pink));
    color: white;
    font-weight: 600;
}

main {
    padding: 2rem;
    min-height: 70vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-light);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title {
    color: var(--primary-dark);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.page-title i {
    color: var(--primary);
}

.btn {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: rgb(255, 255, 255);
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    box-shadow: 0 4px 8px rgba(30, 60, 114, 0.2);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(30, 60, 114, 0.3);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-add {
    background: linear-gradient(135deg, var(--success), #66bb6a);
}

.btn-cancel {
    background: linear-gradient(135deg, var(--gray), #adb5bd);
}

.btn-delete {
    background: linear-gradient(135deg, var(--danger), #ef5350);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

.form-group.full-width {
    flex: 0 0 100%;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 0.95rem;
}

input, select, textarea, button {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius-sm);
    font-family: 'Tajawal', 'Poppins', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
    background-color: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

.custom-select {
    position: relative;
}

.custom-select select {
    appearance: none;
    padding-right: 3rem;
}

.select-arrow {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--gray);
}

.date-picker, .time-picker {
    position: relative;
}

.date-picker i, .time-picker i {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--gray);
    pointer-events: none;
}

.date-picker input, .time-picker input {
    padding-left: 3rem;
}

.priority-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.priority-btn {
    flex: 1;
    padding: 0.7rem;
    border: 2px solid var(--gray-light);
    background: white;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.priority-btn:hover {
    border-color: var(--primary);
}

.priority-btn.active {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
}

.priority-btn[data-priority="high"].active {
    border-color: var(--danger);
    background-color: var(--danger);
}

.priority-btn[data-priority="low"].active {
    border-color: var(--success);
    background-color: var(--success);
}

.task-form {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--box-shadow);
    animation: slideUp 0.4s ease;
    border-top: 4px solid var(--primary);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--gray-light);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn:hover {
    background: var(--primary);
    color: white;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 8px rgba(30, 60, 114, 0.2);
}

.search-box {
    position: relative;
    min-width: 250px;
}

.search-box input {
    padding-left: 2.8rem;
    border-radius: 20px;
}

.search-box i {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    color: var(--gray);
}

.tasks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.task-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-left: 5px solid var(--success);
    animation: slideUp 0.5s ease;
    position: relative;
    overflow: hidden;
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--success), transparent);
}

.task-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.task-card.near-deadline {
    border-left-color: var(--warning);
    animation: pulse 2s infinite;
}

.task-card.near-deadline::before {
    background: linear-gradient(90deg, var(--warning), transparent);
}

.task-card.overdue {
    border-left-color: var(--danger);
}

.task-card.overdue::before {
    background: linear-gradient(90deg, var(--danger), transparent);
}

.task-card.high-priority {
    border-left-color: var(--accent-pink);
}

.task-card.high-priority::before {
    background: linear-gradient(90deg, var(--accent-pink), transparent);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.task-title {
    font-size: 1.3rem;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.task-type {
    background-color: var(--info-light);
    color: var(--info);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.task-details {
    margin-bottom: 1.5rem;
}

.task-detail {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
    color: var(--gray);
    font-size: 0.95rem;
}

.task-detail i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
}

.task-status {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-on-time {
    background-color: var(--success-light);
    color: var(--success);
}

.status-near-deadline {
    background-color: var(--warning-light);
    color: var(--warning);
}

.status-overdue {
    background-color: var(--danger-light);
    color: var(--danger);
}

.time-left {
    font-weight: 600;
    margin-top: 0.5rem;
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    background-color: var(--info-light);
    color: var(--info);
    font-size: 0.9rem;
}

.priority-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.priority-high {
    background-color: #ffebee;
    color: var(--danger);
}

.priority-medium {
    background-color: #fff3e0;
    color: var(--warning);
}

.priority-low {
    background-color: #e8f5e9;
    color: var(--success);
}

.grades-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.summary-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.8rem;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
    border-top: 4px solid var(--primary);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.summary-card h3 {
    color: var(--primary-dark);
    margin-bottom: 1.2rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.grade-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.grade-excellent {
    color: var(--success);
}

.grade-good {
    color: var(--info);
}

.grade-average {
    color: var(--warning);
}

.grade-poor {
    color: var(--danger);
    animation: pulse 2s infinite;
}

.progress-container {
    margin-top: 1.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray);
}

.progress-bar {
    height: 12px;
    background-color: var(--gray-light);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-bar.small {
    height: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-in-out;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg, 
        rgba(255, 255, 255, 0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.2) 75%, 
        transparent 75%, 
        transparent
    );
    z-index: 1;
    background-size: 50px 50px;
    animation: move 2s linear infinite;
    border-radius: 6px;
}

@keyframes move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

.progress-excellent {
    background: linear-gradient(to right, var(--success), #8BC34A);
}

.progress-good {
    background: linear-gradient(to right, var(--info), #03A9F4);
}

.progress-average {
    background: linear-gradient(to right, var(--warning), #FFC107);
}

.progress-poor {
    background: linear-gradient(to right, var(--danger), #FF5722);
}

.grade-status {
    margin-top: 1rem;
    padding: 0.7rem;
    border-radius: var(--border-radius-sm);
    background-color: var(--info-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.subject-level {
    margin-top: 1rem;
}

.level-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.stats-mini {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.warning-card {
    background: linear-gradient(135deg, #fff3e0, #ffecb3);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-left: 5px solid var(--warning);
    animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.warning-icon {
    width: 50px;
    height: 50px;
    background: var(--warning);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.warning-content h4 {
    color: var(--warning);
    margin-bottom: 0.5rem;
}

.warning-content ul {
    margin-top: 0.5rem;
    padding-right: 1.5rem;
}

.warning-content li {
    margin-bottom: 0.3rem;
    color: var(--dark);
}

.settings-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.8rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.settings-card h3 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-input input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-light);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.range-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.range-value {
    font-weight: 600;
    color: var(--primary);
    min-width: 40px;
    text-align: center;
}

.grades-form {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--box-shadow);
    border-top: 4px solid var(--info);
}

.grades-form h3 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grade-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grade-input {
    background: var(--light);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.grade-input label {
    font-weight: 600;
    margin-bottom: 1rem;
    display: block;
}

.grade-input-with-btn {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.grade-input-with-btn input {
    flex: 1;
}

.grade-slider {
    margin-top: 0.5rem;
}

.grade-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-light);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.grade-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.grade-preview {
    background: var(--light);
    border-radius: var(--border-radius-sm);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.grade-preview h4 {
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
}

.grade-preview h4 span {
    font-weight: 700;
    color: var(--primary);
}

.subjects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.subject-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.8rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-top: 4px solid var(--info);
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.subject-name {
    font-size: 1.4rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.subject-grade-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.subject-grade-input {
    text-align: center;
}

.subject-grade-input label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--gray);
    display: block;
}

.subject-grade-input input {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.8rem;
}

.subject-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-light);
}

.analysis-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    margin-top: 2rem;
}

.analysis-section h3 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.analysis-card {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.analysis-card h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.chart-container {
    height: 200px;
    position: relative;
}

.strengths-weaknesses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.sw-item h5 {
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sw-item ul {
    padding-right: 1.2rem;
}

.sw-item li {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.notes-page {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    min-height: 70vh;
}

.notes-sidebar {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sidebar-header h3 {
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notes-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.notes-list-sidebar {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}

.note-item-sidebar {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border-right: 3px solid var(--info);
    background: var(--light);
}

.note-item-sidebar:hover {
    background: var(--info-light);
    transform: translateX(-5px);
}

.note-item-sidebar.active {
    background: var(--info-light);
    border-right-color: var(--primary);
}

.note-item-sidebar h4 {
    color: var(--primary-dark);
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.note-item-sidebar p {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray);
}

.empty-state-sidebar {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.empty-state-sidebar i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.notes-main {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
}

.notes-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.note-title-input input {
    font-size: 1.5rem;
    font-weight: 600;
    border: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--gray-light);
    border-radius: 0;
}

.note-title-input input:focus {
    border-bottom-color: var(--primary);
    box-shadow: none;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--box-shadow-lg);
    padding: 0.5rem;
    z-index: 100;
    min-width: 150px;
}

.category-option {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    background: none;
    text-align: right;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.category-option:hover {
    background: var(--light);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

.toolbar-group {
    display: flex;
    gap: 0.2rem;
    padding: 0.2rem;
    background: var(--light);
    border-radius: var(--border-radius-sm);
}

.tool-btn {
    background: transparent;
    border: none;
    border-radius: 5px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: var(--dark);
}

.tool-btn:hover {
    background: rgba(30, 60, 114, 0.1);
}

.tool-btn.active {
    background: var(--primary);
    color: white;
}

.font-size-dropdown {
    position: absolute;
    top: 100%;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--box-shadow);
    padding: 0.5rem;
    z-index: 100;
    min-width: 100px;
}

.font-size-dropdown button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    text-align: right;
    cursor: pointer;
    transition: var(--transition-fast);
}

.font-size-dropdown button:hover {
    background: var(--light);
}

.color-picker {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
}

.editor-content {
    flex: 1;
    margin-bottom: 1.5rem;
}

.note-content {
    width: 100%;
    height: 100%;
    min-height: 300px;
    padding: 1.5rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-family: 'Tajawal', 'Poppins', sans-serif;
    font-size: 1rem;
    resize: none;
    outline: none;
    overflow-y: auto;
    transition: var(--transition);
}

.note-content:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

.note-content[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: var(--gray);
    pointer-events: none;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
}

.editor-info {
    font-size: 0.9rem;
    color: var(--gray);
    display: flex;
    gap: 1rem;
}

.editor-buttons {
    display: flex;
    gap: 1rem;
}

.note-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.note-viewer-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
}

.note-viewer-header h2 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.note-meta {
    display: flex;
    gap: 1rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.note-category {
    background: var(--info-light);
    color: var(--info);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.note-important {
    color: var(--accent-yellow);
}

.note-viewer-content {
    flex: 1;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--border-radius);
    overflow-y: auto;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.note-viewer-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.notes-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.empty-content i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1.5rem;
}

.empty-content h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.empty-content p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.welcome-section {
    animation: fadeIn 1s ease;
}

.welcome-content h2 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 2rem;
}

.subtitle {
    color: var(--gray);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.8rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    text-align: center;
    border-top: 4px solid var(--primary);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-lg);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.8rem;
}

.feature-card h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.feature-card p {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.feature-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.feature-link:hover {
    color: var(--primary-dark);
    gap: 0.8rem;
}

.stats-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 2.5rem;
}

.stats-section h3 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--light);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.stat-card h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.stat-card p {
    color: var(--gray);
    font-size: 0.9rem;
}

.tips-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.tips-section h3 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: linear-gradient(135deg, #f6d365, #fda085);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    color: white;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(253, 160, 133, 0.3);
}

.tip-card i {
    font-size: 1.5rem;
    margin-top: 0.2rem;
}

.tip-card p {
    flex: 1;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--gray);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: #ddd;
}

.empty-state h3 {
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
    font-size: 1.5rem;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border-radius: var(--border-radius);
    padding: 1.2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    animation: slideInRight 0.5s ease, glow 2s infinite alternate;
    border-left: 5px solid var(--warning);
    max-width: 400px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes glow {
    from { box-shadow: 0 0 10px rgba(255, 152, 0, 0.5); }
    to { box-shadow: 0 0 20px rgba(255, 152, 0, 0.8); }
}

.notification-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--warning), #ffb74d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-content h4 {
    color: var(--dark);
    margin-bottom: 0.3rem;
}

.notification-content p {
    color: var(--gray);
    font-size: 0.9rem;
}

.close-notification {
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;
}

.close-notification:hover {
    background: var(--gray-light);
    color: var(--dark);
}

footer {
    background-color: var(--primary-dark);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.developer-info {
    margin-bottom: 1rem;
}

.developer-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-yellow);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-link {
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--accent-yellow);
    transform: translateY(-3px);
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 1rem;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .notes-page {
        grid-template-columns: 1fr;
    }
    
    .notes-sidebar {
        margin-bottom: 2rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .grades-summary {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-container {
        border-radius: 0;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        justify-content: center;
    }
    
    main {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .tasks-container, .subjects-container, .notes-list {
        grid-template-columns: 1fr;
    }
    
    .grades-summary, .analysis-grid, .strengths-weaknesses {
        grid-template-columns: 1fr;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
    
    .notification {
        left: 1rem;
        right: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .grade-inputs {
        grid-template-columns: 1fr;
    }
    
    .note-actions {
        flex-direction: column;
    }
    
    .tips-slider {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .task-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .editor-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .editor-buttons {
        flex-direction: column;
    }
    
    .note-viewer-actions {
        flex-direction: column;
    }
    
    .warning-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
    }
}

.hidden {
    display: none !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.editor-toolbar,
.editor-actions,
.category-dropdown,
.font-size-dropdown,
.color-picker {
    position: relative;
    z-index: 1;
}

.link-dropdown,
.image-dropdown {
    position: absolute;
    top: calc(100% + 8px); 
    left: 0;
    background: #fff;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 18px 40px rgba(0,0,0,0.15);
    padding: 0.9rem;
    z-index: 2000;
    min-width: 300px;
    max-width: 420px;
    margin-top: 0;
    will-change: transform, opacity;
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
    animation: dropdownFade 180ms cubic-bezier(.2,.9,.2,1);
    pointer-events: auto;
}

@media (max-width: 420px) {
    .link-dropdown,
    .image-dropdown {
        min-width: calc(100vw - 32px);
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
}

.link-dropdown .dropdown-inner,
.image-dropdown .dropdown-inner {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px; 
}

.dropdown-inner label {
    font-size: 0.95rem;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.dropdown-inner input,
.dropdown-inner textarea,
.dropdown-inner select {
    padding: 0.65rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    background: #fff;
}

.or-separator {
    text-align: center;
    margin: 0.45rem 0;
    color: var(--gray);
    position: relative;
    font-size: 0.9rem;
}

.or-separator:before,
.or-separator:after {
    content: "";
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--gray-light);
}

.or-separator:before { left: 0; transform: translateY(-50%); }
.or-separator:after  { right: 0; transform: translateY(-50%); }

.image-preview-wrapper {
    margin-top: 0.5rem;
    text-align: center;
}

.image-preview-wrapper img {
    max-width: 100%;
    max-height: 160px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    margin-top: 0.5rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.dropdown-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.dropdown-actions .btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.95rem;
}

.note-viewer-content {
    line-height: 1.9;
    font-size: 1.05rem;
}

.note-viewer-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}


.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.progress-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
}