/* ============================================
   DiaLink - Pure CSS3 Framework
   نظام CSS3 خالص بدون Bootstrap
   ============================================ */

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body, 'Tajawal', sans-serif);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary, #323F4B);
    background-color: var(--gray-50, #FAFBFC);
    direction: rtl;
    text-align: right;
}

/* ===== متغيرات CSS ===== */
:root {
    --primary-blue: #1E40AF;        /* الأزرق الداكن - من "Link" */
    --primary-blue-dark: #1E3A8A;
    --primary-blue-light: #3B82F6;
    --primary-blue-10: rgba(30, 64, 175, 0.1);
    
    --secondary-green: #4ADE80;      /* الأخضر الفاتح - من "Dia" */
    --secondary-green-dark: #22C55E;
    --secondary-green-light: #86EFAC;
    --secondary-green-10: rgba(74, 222, 128, 0.1);
    
    --white: #FFFFFF;
    --gray-50: #FAFBFC;
    --gray-100: #F5F7FA;
    --gray-200: #E4E7EB;
    --gray-300: #CBD2D9;
    --gray-400: #9AA5B1;
    --gray-500: #7B8794;
    --gray-600: #616E7C;
    --gray-700: #52606D;
    --gray-800: #3E4C59;
    --gray-900: #323F4B;
    
    --text-primary: #323F4B;
    --text-secondary: #52606D;
    --text-muted: #7B8794;
    
    --alert-red: #E74C3C;
    --alert-red-10: rgba(231, 76, 60, 0.1);
    --warning-amber: #F39C12;
    --warning-amber-10: rgba(243, 156, 18, 0.1);
    --success-green: #4ADE80;
    --info-blue: #1E40AF;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Tajawal', sans-serif;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover {
    color: var(--primary-blue-dark);
}

/* ===== Grid System (CSS Grid) ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

.row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin: 0 -0.5rem;
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Responsive Grid */
@media (min-width: 768px) {
    .col-md-1 { grid-column: span 1; }
    .col-md-2 { grid-column: span 2; }
    .col-md-3 { grid-column: span 3; }
    .col-md-4 { grid-column: span 4; }
    .col-md-5 { grid-column: span 5; }
    .col-md-6 { grid-column: span 6; }
    .col-md-7 { grid-column: span 7; }
    .col-md-8 { grid-column: span 8; }
    .col-md-9 { grid-column: span 9; }
    .col-md-10 { grid-column: span 10; }
    .col-md-11 { grid-column: span 11; }
    .col-md-12 { grid-column: span 12; }
}

@media (min-width: 992px) {
    .col-lg-1 { grid-column: span 1; }
    .col-lg-2 { grid-column: span 2; }
    .col-lg-3 { grid-column: span 3; }
    .col-lg-4 { grid-column: span 4; }
    .col-lg-5 { grid-column: span 5; }
    .col-lg-6 { grid-column: span 6; }
    .col-lg-7 { grid-column: span 7; }
    .col-lg-8 { grid-column: span 8; }
    .col-lg-9 { grid-column: span 9; }
    .col-lg-10 { grid-column: span 10; }
    .col-lg-11 { grid-column: span 11; }
    .col-lg-12 { grid-column: span 12; }
}

/* ===== Flexbox Utilities ===== */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.align-stretch { align-items: stretch; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    white-space: nowrap;
    min-height: 44px;
    text-decoration: none;
}

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

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

.btn-success {
    background-color: var(--secondary-green);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background-color: var(--secondary-green-dark);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--alert-red);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background-color: #C0392B;
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline-primary:hover {
    background-color: var(--primary-blue-10);
    border-color: var(--primary-blue-dark);
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--gray-300);
}

.btn-outline-secondary:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 52px;
}

.w-100 { width: 100%; }

/* ===== Cards ===== */
.card {
    background-color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.125rem;
    border-bottom: none;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* ===== Forms ===== */
.form-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all 0.25s ease;
    min-height: 44px;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-10);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
}

.input-group .form-control {
    border-left: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    margin: 0;
}

/* ===== Tables ===== */
.table {
    width: 100%;
    background-color: var(--white);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead {
    background-color: var(--gray-50);
}

.table thead th {
    padding: 1rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-align: right;
    border-bottom: 2px solid var(--gray-200);
}

.table tbody td {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr {
    transition: background-color 0.25s ease;
}

.table tbody tr:hover {
    background-color: var(--primary-blue-10);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Alerts ===== */
.alert {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert-success {
    background-color: var(--secondary-green-10);
    color: var(--secondary-green-dark);
    border-right: 4px solid var(--secondary-green);
}

.alert-danger {
    background-color: var(--alert-red-10);
    color: #C0392B;
    border-right: 4px solid var(--alert-red);
}

.alert-warning {
    background-color: var(--warning-amber-10);
    color: #D68910;
    border-right: 4px solid var(--warning-amber);
}

.alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: #2874A6;
    border-right: 4px solid var(--info-blue);
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

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

.badge-success {
    background-color: var(--secondary-green);
    color: var(--white);
}

.badge-danger {
    background-color: var(--alert-red);
    color: var(--white);
}

.badge-warning {
    background-color: var(--warning-amber);
    color: var(--white);
}

.badge-info {
    background-color: var(--info-blue);
    color: var(--white);
}

.badge-secondary {
    background-color: var(--gray-500);
    color: var(--white);
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary-blue); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--white); }

.bg-primary { background-color: var(--primary-blue); }
.bg-white { background-color: var(--white); }
.bg-gray-50 { background-color: var(--gray-50); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.border-0 { border: none; }

/* ===== Login Page ===== */
.login-page {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 20s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.login-page .card {
    max-width: 450px;
    width: 100%;
    z-index: 1;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    background-color: rgba(255, 255, 255, 0.98);
}

/* ===== Sidebar ===== */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: 0;
    position: sticky;
    top: 0;
    box-shadow: var(--shadow-lg);
}

.sidebar .logo {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .logo h5 {
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 700;
    margin: 1rem 0 0 0;
}

.sidebar .nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.85);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
    font-size: 1rem;
    font-weight: 500;
    min-height: 52px;
    text-decoration: none;
}

.sidebar .nav-link i {
    width: 24px;
    font-size: 1.125rem;
    text-align: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    padding-right: 2rem;
    border-right: 3px solid var(--white);
}

/* ===== Main Content ===== */
.main-content {
    padding: 2rem;
    background-color: var(--gray-50);
    min-height: 100vh;
}

/* ===== Responsive ===== */
/* تم نقل جميع قواعد التصميم المتجاوب إلى responsive.css */

/* ===== Min Height Utilities ===== */
.min-vh-100 {
    min-height: 100vh;
}

/* ===== Position Utilities ===== */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }

.top-0 { top: 0; }
.start-100 { right: 100%; }
.translate-middle {
    transform: translate(50%, -50%);
}

/* ===== List Group ===== */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background-color: var(--white);
    transition: background-color 0.25s ease;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: var(--gray-50);
}

.list-group-flush .list-group-item {
    border-left: none;
    border-right: none;
}

/* ===== Icon Box ===== */
.icon-box {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.icon-box.primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
}

.icon-box.success {
    background: linear-gradient(135deg, var(--secondary-green) 0%, var(--secondary-green-dark) 100%);
    color: var(--white);
}

.icon-box.danger {
    background: linear-gradient(135deg, var(--alert-red) 0%, #C0392B 100%);
    color: var(--white);
}

.icon-box.info {
    background: linear-gradient(135deg, var(--info-blue) 0%, #2874A6 100%);
    color: var(--white);
}

/* ===== Stats Card ===== */
.stats-card {
    text-align: center;
    padding: 2rem;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stats-card .number {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    font-family: var(--font-heading);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stats-card .label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* ===== Symptom Scale ===== */
.symptom-scale {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.symptom-scale-item {
    flex: 1;
    min-width: 50px;
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid var(--gray-200);
    background-color: var(--white);
    font-weight: 600;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.symptom-scale-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
    background-color: var(--primary-blue-10);
}

.symptom-scale-item.active {
    border-color: var(--primary-blue);
    background-color: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

