/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 14px;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-block {
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

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

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

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Header */
.main-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 24px;
}

.main-nav {
    display: flex;
    gap: 8px;
    margin-left: 40px;
    flex: 1;
    overflow-x: auto;
}

.main-nav.active {
    display: flex;
}

.nav-link {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text);
    border-radius: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
    background: var(--light);
    color: var(--primary);
}

.nav-link i {
    margin-right: 6px;
}

.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.user-info:hover {
    background: var(--light);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    margin-top: 8px;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s;
}

.user-dropdown a:hover {
    background: var(--light);
    color: var(--primary);
}

.user-dropdown a i {
    margin-right: 8px;
    width: 20px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 4px;
}

.date-display {
    color: var(--text-light);
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.stat-content h3 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-light);
    font-size: 14px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

.text-muted {
    color: var(--text-light);
    font-size: 14px;
}

/* Prayer Times */
.prayer-times-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prayer-time-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
}

.prayer-time-item span {
    color: var(--text-light);
    font-size: 14px;
}

.prayer-time-item strong {
    color: var(--dark);
    font-size: 16px;
}

/* Schedule List */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.schedule-item.status-completed {
    opacity: 0.6;
    border-left-color: var(--success);
}

.schedule-item.status-cancelled {
    opacity: 0.5;
    border-left-color: var(--danger);
}

.schedule-time {
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
    min-width: 80px;
}

.schedule-content h4 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--dark);
}

.schedule-content p {
    font-size: 13px;
    color: var(--text-light);
}

/* Todo List */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
    border-left: 3px solid var(--text-light);
}

.todo-item.priority-high {
    border-left-color: var(--danger);
}

.todo-item.priority-urgent {
    border-left-color: #dc2626;
}

.todo-item.priority-medium {
    border-left-color: var(--warning);
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Quick Actions */
.quick-actions {
    margin-top: 32px;
}

.quick-actions h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--dark);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}

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

.action-btn i {
    font-size: 32px;
    color: var(--primary);
}

.action-btn span {
    font-size: 14px;
    font-weight: 500;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.data-table td {
    font-size: 14px;
}

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

/* Badge */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

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

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

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-primary {
    background: #ddd6fe;
    color: #5b21b6;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 16px;
        box-shadow: var(--shadow-lg);
        margin-left: 0;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .nav-link {
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .stats-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-container {
        position: relative;
    }
}

/* 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: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 20px;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--danger);
}