:root {
    --primary-color: #1B5C3F;
    --secondary-color: #2d8f6c;
    --accent-color: #06b6d4;
    --gradient-primary: linear-gradient(135deg, #1B5C3F 0%, #2d8f6c 100%);
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
}

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

html, body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background-image: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url('/photos/mosaic1.jpg') !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    color: var(--text-primary);
    height: 100%;
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.navbar {
    background: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.btn {
    border-radius: 10px;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

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

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.btn-gradient:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    padding: 1.25rem;
    border: none;
}

.card-body {
    padding: 1.5rem;
}

.stat-card {
    border-radius: 20px;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card-primary {
    background: var(--gradient-primary);
}

.stat-card-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.stat-card-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-card i {
    opacity: 0.3;
    font-size: 4rem;
}

.course-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.course-card .card-img-top {
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-card:hover .card-img-top {
    transform: scale(1.1);
}

.course-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge-beginner {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-intermediate {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.badge-advanced {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.color-picker-wrapper input[type="color"] {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.color-preview {
    width: 100px;
    height: 60px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.table thead {
    background: var(--gradient-primary);
    color: white;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: var(--bg-light);
}

.progress {
    height: 1.5rem;
    border-radius: 10px;
    background: var(--bg-light);
}

.progress-bar {
    background: var(--gradient-primary);
    transition: width 0.6s ease;
    font-weight: 600;
}

.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 20px 20px 0 0;
}

footer {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: auto;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

footer a {
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--accent-color);
}

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

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

.dropdown-menu {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--gradient-primary);
    color: white;
}

.list-group-item {
    border: none;
    border-radius: 10px !important;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateX(10px);
}

@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    .navbar-brand {
        font-size: 1.25rem;
    }
}

.chatbot-container {
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.chatbot-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    direction: rtl;
}

.message {
    margin-bottom: 15px;
    display: flex;
    animation: slideIn 0.3s ease;
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    word-wrap: break-word;
    line-height: 1.5;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
}

.bot-message .message-content {
    background: #e9ecef;
    color: var(--text-primary);
}

.chatbot-footer {
    border-radius: 0 0 15px 15px;
    border-top: 1px solid var(--border-color);
}

.btn-group .btn {
    border-radius: 8px;
    font-size: 0.9rem;
}

.btn-group .btn-check:checked + .btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

#messagesContainer {
    direction: rtl;
}

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