/**
 * AH Digital Automation - Todo List Application
 * Modern, Professional Design with RTL Support
 */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Authentication Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

/* Language Switcher */
.language-switcher {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: var(--bg-color);
    border-radius: 8px;
}

.language-switcher a {
    color: var(--text-color);
    text-decoration: none;
    padding: 5px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.language-switcher a:hover {
    background: var(--primary-color);
    color: white;
}

.language-switcher a.active {
    background: var(--primary-color);
    color: white;
}

.language-switcher span {
    color: var(--text-light);
    margin: 0 5px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 16px;
}

/* Form Styles */
.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 30px;
    text-align: center;
}

.sidebar-header img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 4px;
}

.sidebar-header p {
    color: var(--text-light);
    font-size: 14px;
}

.user-info {
    background: var(--bg-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.user-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.user-info p {
    color: var(--text-light);
    font-size: 14px;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 30px;
    max-width: 1400px;
}

.content-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h1 {
    font-size: 32px;
    color: var(--text-color);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 20px;
    color: var(--text-color);
}

/* Tasks Grid */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.task-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.task-card.status-completed {
    border-right-color: var(--success-color);
    opacity: 0.8;
}

.task-card.status-in-progress {
    border-right-color: var(--warning-color);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.task-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    flex-grow: 1;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-description {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.task-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-status {
    background: #dbeafe;
    color: #1e40af;
}

.badge-priority {
    background: #fef3c7;
    color: #92400e;
}

.badge-priority.high {
    background: #fee2e2;
    color: #991b1b;
}

.badge-priority.low {
    background: #d1fae5;
    color: #065f46;
}

/* Notes Section */
.notes-section {
    margin-top: 30px;
}

.notes-list {
    display: grid;
    gap: 16px;
}

.note-card {
    background: #fef9e7;
    border-radius: 8px;
    padding: 16px;
    border-right: 3px solid #f59e0b;
    position: relative;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.note-title {
    font-weight: 600;
    color: var(--text-color);
}

.note-content {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

.note-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--danger-color);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-info h3 {
    font-size: 32px;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-light);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        padding: 20px;
    }
    
    .tasks-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auto-save indicator */
.autosave-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--card-bg);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 999;
}

.autosave-indicator.saving {
    display: flex;
    color: var(--warning-color);
}

.autosave-indicator.saved {
    display: flex;
    color: var(--success-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 24px;
}

/* Supervision Requests */
.supervision-request-card {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.supervision-request-card .request-info h3 {
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 18px;
}

.supervision-request-card .request-info p {
    margin: 5px 0;
    color: #64748b;
    font-size: 14px;
}

.supervision-request-card .request-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

[dir="rtl"] .supervision-request-card {
    flex-direction: row-reverse;
}
