* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary-color: #6366f1;
    --accent-color: #f59e0b;
    --text-dark: #01060d;
    --text-light: #6b7280;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --gradient-1: linear-gradient(135deg, #10b981 0%, #6366f1 100%);
    --gradient-2: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --border-radius-lg: 20px;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f8fafc 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* الخلفية المتحركة */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: var(--gradient-1);
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
    background: var(--gradient-2);
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 20%;
    right: 20%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* شريط التنقل */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.user-email {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-left: 1rem;
}

/* الصفحة الرئيسية */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero-section {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-1);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: slideInLeft 1s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    animation: slideInLeft 1s ease-out 0.2s both;
}

.title-gradient {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 2rem;
    animation: slideInLeft 1s ease-out 0.4s both;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    animation: slideInLeft 1s ease-out 0.6s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.hero-visual {
    position: relative;
    height: 500px;
    animation: slideInRight 1s ease-out;
}

.floating-cards {
    position: relative;
    height: 100%;
}

.floating-card {
    position: absolute;
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: float 6s ease-in-out infinite;
}

.floating-card i {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.floating-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.floating-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.card-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.card-2 {
    top: 40%;
    right: 10%;
    animation-delay: 2s;
}

.card-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

/* الميزات */
.features-section {
    padding: 6rem 0;
    background: var(--bg-white);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.highlight {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* الأزرار */
.btn-primary {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-glow {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-glow:hover {
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.6);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-secondary {
    background: var(--gradient-2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

.btn-delete {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: #fed7d7;
    transform: scale(1.1);
}

/* الحاوية الرئيسية */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.app-container {
    display: none;
}

/* البطاقات */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.animated-card {
    animation: slideUp 0.6s ease-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card h2 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.card h2 i {
    color: var(--primary-color);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.notes-count {
    background: var(--gradient-1);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* النماذج */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--bg-white);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    right: 1rem;
    color: var(--text-light);
}

.search-box input {
    padding-right: 3rem;
}

/* معاينة الصورة */
.image-preview {
    margin-top: 0.5rem;
}

.preview-container {
    position: relative;
    display: inline-block;
}

.preview-container img {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--border-radius);
    border: 2px solid #e2e8f0;
}

.btn-remove-image {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* البحث والتصفية */
.search-filter {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    align-items: end;
}

/* شبكة الملاحظات */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.note-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    animation: slideUp 0.6s ease-out;
    cursor: pointer;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.note-header h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin-right: 1rem;
}

.note-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.note-content {
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.6;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.note-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, white);
}

.note-image-preview {
    margin-bottom: 1rem;
}

.note-image-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.note-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag.organ {
    background: #fed7d7;
    color: #c53030;
}

.tag.lesson {
    background: #c6f6d5;
    color: #276749;
}

.note-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword {
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* تفاصيل الملاحظة */
.note-detail {
    padding: 1rem;
}

.note-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
}

.note-detail-header h2 {
    color: var(--text-dark);
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}

.note-detail-content {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.note-detail-image {
    margin-bottom: 2rem;
    text-align: center;
}

.note-detail-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.note-detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-item strong {
    color: var(--text-dark);
    font-weight: 700;
}

.note-detail-keywords {
    margin-bottom: 2rem;
}

.note-detail-keywords strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 700;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* النافذة المنبثقة */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    width: 95%;
    max-width: 400px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease-out;
}

.large-modal {
    max-width: 800px !important;
    max-height: 90vh;
    overflow-y: auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: var(--primary-dark);
}

.close {
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--text-dark);
}

/* الرسائل */
.message {
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
    animation: slideUp 0.3s ease-out;
}

.message.success {
    background: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.message.error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.no-notes {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    grid-column: 1 / -1;
    padding: 2rem;
}

/* spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* أنيميشنات */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* التجاوب */
@media (max-width: 768px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        justify-content: center;
    }

    .nav-container {
        padding: 0 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-filter {
        grid-template-columns: 1fr;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .note-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .notes-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .note-detail-header {
        flex-direction: column;
        gap: 1rem;
    }

    .note-detail-meta {
        grid-template-columns: 1fr;
    }
}

/* تأثيرات إضافية */
.card, .note-card, .btn-primary {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تحسين المظهر للغة العربية */
body {
    font-family: 'Tajawal', 'Segoe UI', 'Noto Sans Arabic', Tahoma, sans-serif;
}

input, textarea, select {
    text-align: right;
}