/* ===========================
   Base Reset & Fonts
=========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: tanha, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@font-face {
    font-family: tanha;
    src: url("./fonts/Tanha.woff") format("woff");
}
@font-face {
    font-family: yekan;
    src: url("../fonts/BYekan.woff") format("woff");
}
@font-face {
    font-family: samim;
    src: url("./fonts/Samim.woff") format("woff");
}
@font-face {
    font-family: yas;
    src: url("../fonts/BYas.woff") format("woff");
}
@font-face {
    font-family: titr;
    src: url("../fonts/BTitrTGEBold.woff") format("woff");
}
/* ===============================
   Modern Moving Particle Background
   (Many floating circles)
=============================== */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind all content */
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}

/* Particle container using box-shadow trick */
body::before {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #4299e1;
    box-shadow:
        50px 100px #38a169,
        150px 300px #e53e3e,
        250px 200px #f6ad55,
        350px 400px #ed64a6,
        450px 150px #4299e1,
        550px 350px #38a169,
        650px 250px #e53e3e,
        750px 500px #f6ad55,
        850px 100px #ed64a6,
        950px 450px #4299e1;
    animation: floatParticles 50s linear infinite;
}

/* Animation for floating effect */
@keyframes floatParticles {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.5);
        opacity: 0;
    }
    25% {
        opacity: 0.6;
    }
    50% {
        transform: translateY(50vh) translateX(50px) scale(1);
        opacity: 0.8;
    }
    75% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-50vh) translateX(-50px) scale(0.5);
        opacity: 0;
    }
}

/* Extra effect: small random particles */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #38a169;
    z-index: -1;
    pointer-events: none;
    box-shadow:
        100px 200px #e53e3e,
        200px 400px #4299e1,
        300px 600px #f6ad55,
        400px 150px #ed64a6,
        500px 300px #38a169,
        600px 500px #e53e3e,
        700px 200px #4299e1,
        800px 400px #f6ad55,
        900px 100px #ed64a6,
        1000px 450px #38a169;
    animation: floatParticlesAlt 60s linear infinite;
}

@keyframes floatParticlesAlt {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.3);
        opacity: 0;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-50vh) translateX(50px) scale(0.3);
        opacity: 0;
    }
}


/* ===========================
   Body & Layout
=========================== */
body {
    background: #f8fafc;
    min-height: 100vh;
    padding: 16px;
    direction: rtl;
    line-height: 1.65;
    color: #1a202c;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===========================
   Header
=========================== */
header {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -1px rgba(0,0,0,0.06);
    margin-bottom: 32px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

/* ===========================
   Typography
=========================== */
h1, h2, h3, h4, h5 {
    line-height: 1.35;
}

h1 {
    color: #1a202c;
    margin-bottom: 12px;
    font-size: 28px;
    font-weight: 700;
}

.subtitle {
    color: #4a5568;
    font-size: 15px;
    font-weight: 400;
    opacity: 0.9;
}

p {
    line-height: 1.65;
    color: #2d3748;
}

/* ===========================
   Dashboard & Grid
=========================== */
.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr 2fr;
        gap: 32px;
    }
}

/* ===========================
   Cards
=========================== */
.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 16px 24px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card h2 {
    color: #1a202c;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #4299e1;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===========================
   Forms
=========================== */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 500;
    font-size: 15px;
}

input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1a202c;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66,153,225,0.1);
}

/* ===========================
   Buttons
=========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #4299e1 0%, #2b6cb0 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.25s ease;
    text-decoration: none;
    text-align: center;
    min-height: 48px;
    line-height: 1;
    box-shadow: 0 4px 6px rgba(66,153,225,0.2);
}

.btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(66,153,225,0.25);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(66,153,225,0.2);
}

.btn-danger {
    background: #e53e3e;
}

.btn-danger:hover {
    background: #c53030;
    box-shadow: 0 10px 15px -3px rgba(229,62,62,0.3);
}

.btn-success {
    background: #38a169;
}

.btn-success:hover {
    background: #2f855a;
    box-shadow: 0 10px 15px -3px rgba(56,161,105,0.3);
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
    margin: 0 4px;
    min-height: 36px;
}

/* ===========================
   Appointments List
=========================== */
.appointments-list {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4299e1 transparent;
}

.appointments-list::-webkit-scrollbar {
    width: 6px;
}

.appointments-list::-webkit-scrollbar-track {
    background: transparent;
}

.appointments-list::-webkit-scrollbar-thumb {
    background-color: #4299e1;
    border-radius: 6px;
}

.appointments-list::-webkit-scrollbar-thumb:hover {
    background-color: #3182ce;
}

.appointment-item {
    background: #f7fafc;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    border-left: 6px solid #4299e1;
    border-right: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.appointment-item:hover {
    transform: translateX(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.appointment-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

@media (min-width: 640px) {
    .appointment-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.patient-name {
    font-weight: 600;
    color: #1a202c;
    font-size: 17px;
    line-height: 1.4;
}

.appointment-time {
    background: #4299e1;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.appointment-details {
    color: #4a5568;
    font-size: 15px;
    margin-bottom: 16px;
    display: grid;
    gap: 8px;
}

.appointment-date {
    background: #38a169;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.appointment-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ===========================
   Status Badges
=========================== */
.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: fit-content;
    transition: all 0.3s ease;
}

.status-pending {
    background: #ed8936;
    color: white;
    box-shadow: 0 0 10px rgba(237,137,54,0.4);
}

.status-confirmed {
    background: #38a169;
    color: white;
    box-shadow: 0 0 10px rgba(56,161,105,0.4);
}

.status-cancelled {
    background: #e53e3e;
    color: white;
    box-shadow: 0 0 10px rgba(229,62,62,0.4);
}

/* ===========================
   Empty State
=========================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #718096;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 24px;
    color: #cbd5e0;
    opacity: 0.7;
}

/* ===========================
   Calendar
=========================== */
.persian-calendar {
    font-family: 'Vazir', sans-serif;
    font-size: 15px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    text-align: center;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a202c;
    padding: 0 4px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    gap: 8px;
}

.calendar-day {
    padding: 12px 8px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    min-height: 44px;
}

.calendar-day:hover {
    background: #ebf8ff;
    border-color: #cbd5e0;
    transform: scale(1.05);
}

.calendar-day.today {
    background: #4299e1;
    color: white;
    border: 3px solid #3182ce;
    box-shadow: 0 4px 8px rgba(49,130,206,0.3);
}

.calendar-day.has-appointment {
    background: #38a169;
    color: white;
    border-color: #38a169;
    box-shadow: 0 4px 8px rgba(56,161,105,0.3);
}

.calendar-day.selected {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

/* ===========================
   Alerts
=========================== */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid;
}

.alert-success {
    background: #f0fff4;
    color: #22543d;
    border-color: #9ae6b4;
}

.alert-error {
    background: #fff5f5;
    color: #742a2a;
    border-color: #fc8181;
}

/* ===========================
   Responsive & Mobile
=========================== */
@media (max-width: 640px) {
    body { padding: 12px; }
    header { padding: 20px 16px; }
    h1 { font-size: 24px; }
    .card { padding: 20px 16px; }
    .btn { padding: 12px 20px; min-height: 44px; font-size: 15px; width: 100%; }
    .appointment-actions .btn { flex: 1; min-width: 0; }
    input, select, textarea { padding: 12px 14px; font-size: 15px; }
    .calendar-day { padding: 8px 6px; font-size: 14px; min-height: 40px; }
}

/* ===========================
   Dark Mode
=========================== */
@media (prefers-color-scheme: dark) {
    body { background: #1a202c; color: #e2e8f0; }
    .card { background: #2d3748; border-color: #4a5568; }
    header { background: #2d3748; border-color: #4a5568; }
    h1, .card h2, .patient-name { color: #e2e8f0; }
    label, .subtitle { color: #cbd5e0; }
    input, select, textarea { background: #4a5568; border-color: #718096; color: #e2e8f0; }
    input:focus, select:focus, textarea:focus { border-color: #4299e1; box-shadow: 0 0 0 3px rgba(66,153,225,0.2); }
    .appointment-item { background: #4a5568; border-color: #718096; }
    .calendar-day:hover { background: #4a5568; }
    .calendar-header { color: #e2e8f0; }
}

/* ===========================
   Print Styles
=========================== */
@media print {
    body { background: white; padding: 0; }
    .btn, .appointment-actions { display: none; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
