@font-face {
    font-family: Parastoo;
    src: url('Parastoo.eot');
    src: url('Parastoo.eot?#iefix') format('embedded-opentype'),
        url('Parastoo.woff2') format('woff2'),
        url('Parastoo.woff') format('woff'),
        url('Parastoo.ttf') format('truetype');
    font-weight: normal;
}
@font-face {
    font-family: Parastoo;
    src: url('Parastoo-Bold.eot');
    src: url('Parastoo-Bold.eot?#iefix') format('embedded-opentype'),
        url('Parastoo-Bold.woff2') format('woff2'),
        url('Parastoo-Bold.woff') format('woff'),
        url('Parastoo-Bold.ttf') format('truetype');
    font-weight: bold;
}

/* --- 1. Variables and Base Setup --- */
:root {
    /* Color Palette (Warm & Organic) */
    --text-dark: #302910;
    --primary: #7E7B63;
    --accent: #86440B;
    --card-bg-tone: #E8B985;

    /* Glassmorphism Effect */
    --glass-bg: rgba(255, 255, 255, 0.05); /* Base glass background */
    --glass-border: rgba(255, 255, 255, 0.2); /* Base glass border */
    --glass-shadow: rgba(0, 0, 0, 0.2); /* Base glass shadow */
    --text-on-glass: #f0f0f0; /* Slightly off-white for text */
    --glow-color: rgba(134, 68, 11, 0.3); /* Glowing border from accent color */

    /* Typography */
    --font-persian: 'Parastoo', Arial, sans-serif;
    --font-english: 'Cormorant Garamond', serif;
    --font-signature: 'Arial', 'Helvetica Neue', sans-serif;
    --font-login-text: 'Parastoo', Arial, sans-serif;

    /* New specific colors for audio player */
    --audio-play-normal: rgba(255, 255, 255, 0.15); /* Transparent white */
    --audio-play-hover: rgba(39, 174, 96, 0.3); /* Greenish transparent */
    --audio-play-active: rgba(39, 174, 96, 0.7); /* Solid green for playing state */
    --audio-glow-green: rgba(39, 174, 96, 0.4);
}

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

body {
    font-family: var(--font-persian);
    background-color: #0c0c0c;
    color: var(--text-on-glass);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- 2. Background and Layout --- */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('man.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
    filter: blur(10px) brightness(0.5);
    transform: scale(1.1);
}

.main-content {
    min-height: calc(100vh - 60px);
    padding: 30px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- 3. REFINED Glassmorphism Card Style --- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 24px 0 var(--glass-shadow), 0 0 15px var(--glow-color);
    transition: all 0.4s ease;
}

.card-header {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-on-glass);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
}

/* --- 4. Typography --- */
h1, h2, h3 {
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-on-glass);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
h1 { font-size: 2.2em; }
h2 { font-size: 1.8em; }
h3 { font-size: 1.5em; }
a {
    color: var(--card-bg-tone);
    text-decoration: none;
    font-weight: 700;
}
a:hover {
    text-decoration: underline;
}

/* --- 5. Forms and Buttons --- */
.button, input[type="submit"] {
    background-color: var(--accent);
    color: white;
    padding: 10px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-persian);
    font-size: 0.95em;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.button:hover, input[type="submit"]:hover {
    background-color: #a0520d;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
input[type="text"], input[type="search"], textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    font-family: var(--font-persian);
    font-size: 0.95em;
    color: var(--text-on-glass);
}
textarea { resize: vertical; }

/* --- 6. Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
th, td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--glass-border);
}
th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 700;
}
tbody tr {
    transition: background-color 0.3s ease;
}
tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- 7. Footer and Signature (Refined) --- */
.site-footer {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.2), rgba(0,0,0,0));
    padding-top: 20px;
}
.signature {
    font-family: var(--font-signature);
    font-size: 0.9em;
    font-weight: normal;
    color: rgba(240, 240, 240, 0.6);
    opacity: 1;
    text-shadow: none;
}


/* --- 8. PRESERVED FUNCTIONAL STYLES (ADAPTED) --- */
.triage-indicator {
    padding: 4px 12px;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 0.85em;
    text-align: center;
    display: inline-block;
}
.triage-high-priority { background-color: #e74c3c; animation: pulse 1.5s infinite; }
.triage-medium-priority { background-color: #f39c12; }
.triage-low-priority { background-color: #27ae60; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.modal {
    position: fixed; z-index: 100; left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}
.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 8% auto;
    padding: 25px;
    border: 1px solid var(--glass-border);
    width: 85%;
    max-width: 600px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 6px 24px 0 var(--glass-shadow);
}
.close-button {
    color: var(--text-on-glass);
    position: absolute;
    top: 12px;
    left: 15px;
    font-size: 24px;
    font-weight: bold;
    opacity: 0.7;
}
.close-button:hover, .close-button:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    opacity: 1;
}

.flash-message {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 12px;
    background: rgba(44, 62, 80, 0.7);
    color: white;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

/* --- 9. Landing Page Styles (Adjusted) --- */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80vh;
    padding-top: 50px;
}
.landing-hero { margin-bottom: 40px; }
.landing-title { font-size: 3em; font-weight: 700; text-shadow: 0 3px 10px rgba(0,0,0,0.5); }
.landing-subtitle { font-size: 1.3em; color: var(--text-on-glass); opacity: 0.9; }
.entry-points { display: flex; gap: 25px; flex-wrap: wrap; justify-content: center; }
.entry-card {
    width: 280px;
    text-align: center;
    transition: all 0.3s ease;
    color: var(--text-on-glass);
    padding: 20px;
}
.entry-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 10px 30px 0 var(--glass-shadow), 0 0 20px var(--glow-color);
    text-decoration: none;
}
.entry-card i { width: 40px; height: 40px; color: var(--card-bg-tone); margin-bottom: 15px; }
.entry-card h2 { color: #fff; font-size: 1.4em; }
.entry-card p { opacity: 0.8; font-size: 0.9em; }

.ai-report-content p {
    margin-bottom: 0.4em;
}
.ai-report-content strong {
    color: var(--card-bg-tone);
}
.consultation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.consultation-card-link {
    text-decoration: none;
    color: inherit;
}

.consultation-card {
    margin-bottom: 0;
    transition: all 0.3s ease;
    border-left: 5px solid var(--primary);
    padding: 20px;
}

.consultation-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px 0 var(--glass-shadow), 0 0 25px var(--glow-color);
}

.consultation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    font-weight: 700;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.consultation-card-body p {
    margin-bottom: 6px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    font-size: 0.95em;
}

.icon-small {
    width: 14px;
    height: 14px;
    margin-left: 6px;
    opacity: 0.8;
}

.consultation-card-footer {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
    font-weight: 700;
    color: var(--card-bg-tone);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}
@keyframes flicker-red {
    0%, 100% {
        box-shadow: 0 6px 24px 0 var(--glass-shadow), 0 0 12px rgba(231, 76, 60, 0.5);
        border-color: rgba(231, 76, 60, 0.6);
    }
    50% {
        box-shadow: 0 6px 24px 0 var(--glass-shadow), 0 0 25px 4px rgba(231, 76, 60, 0.9);
        border-color: rgba(231, 76, 60, 1);
    }
}

.consultation-card.triage-card-high {
    animation: flicker-red 2.5s infinite;
}

.consultation-card.triage-card-medium {
    border-color: rgba(243, 156, 18, 0.7);
    box-shadow: 0 6px 24px 0 var(--glass-shadow), 0 0 16px rgba(243, 156, 18, 0.4);
}

.consultation-card.triage-card-low {
    border-color: rgba(39, 174, 96, 0.6);
    box-shadow: 0 6px 24px 0 var(--glass-shadow), 0 0 12px rgba(39, 174, 96, 0.2);
}
.sort-btn {
    background-color: transparent;
    border: 1px solid var(--glass-border);
    padding: 7px 18px;
    font-size: 0.9em;
}
.sort-btn.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
}
.sort-btn:hover {
    background-color: var(--glass-bg);
    border-color: var(--accent);
}
.patient-detail-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    align-items: start;
}

.patient-info-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-item-list p {
    margin-bottom: 4px;
    font-weight: bold;
    opacity: 0.8;
    font-size: 0.95em;
}

.history-item-list ul {
    list-style-type: none;
    padding-right: 12px;
    margin-bottom: 12px;
}

.history-item-list li {
    font-size: 0.9em;
    opacity: 1;
}

.consultation-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.consultation-card-small {
    padding: 12px;
    margin-bottom: 0;
}

/* --- 10. Login Page Styles (Further Refined) --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px);
    padding: 20px;
}

.login-card {
    max-width: 450px;
    width: 100%;
    padding: 35px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(134, 68, 11, 0.6);
    margin-top: -30px;
}

.login-header {
    margin-bottom: 30px;
}

.login-icon {
    width: 60px;
    height: 60px;
    color: var(--card-bg-tone);
    margin-bottom: 15px;
}

.login-header h2 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

.login-header p {
    font-family: var(--font-login-text);
    font-size: 1.05em;
    color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
    font-family: var(--font-login-text);
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    height: 50px;
    line-height: 24px;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 1em;
    border-radius: 10px;
    color: #FFF;
    box-sizing: border-box;
    font-family: var(--font-login-text);
}
.login-card input[type="text"]::placeholder,
.login-card input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-login-text);
}

.login-button {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border-radius: 10px;
    margin-top: 15px;
    background-color: var(--accent);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent);
}

.login-button:hover {
    background-color: #a0520d;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* --- 11. Global Clock Styles --- */
.global-clock {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    font-family: var(--font-persian);
    color: var(--text-on-glass);
    font-size: 0.9em;
    text-align: right;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.global-clock .clock-item {
    white-space: nowrap;
}

.global-clock #current-time {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--card-bg-tone);
}

@media (max-width: 768px) {
    .global-clock {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 0.8em;
    }
    .global-clock #current-time {
        font-size: 1.1em;
    }
}

/* --- 12. Consultation Detail Page Specific Styles --- */
.page-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    margin: 0;
    border: none;
    font-size: 2.2em;
    color: var(--text-on-glass);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.consultation-id-display {
    font-size: 0.6em;
    opacity: 0.7;
    margin-right: 10px;
    vertical-align: middle;
}

/* SOAP Report Grid */
.ai-report-main-card {
    padding: 0; /* Remove padding of the main card if it's just a container for inner cards */
    margin-bottom: 20px;
}

.soap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.soap-card {
    background: rgba(255, 255, 255, 0.05); /* Lighter background for inner cards */
    backdrop-filter: blur(20px); /* Adjusted blur for inner cards */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15); /* Lighter border for inner cards */
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.3), 0 0 10px rgba(134, 68, 11, 0.2); /* Adjusted shadow/glow */
    padding: 15px;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.soap-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 rgba(0, 0, 0, 0.4), 0 0 15px rgba(134, 68, 11, 0.3);
}

.soap-header {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--card-bg-tone);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.soap-label {
    font-size: 0.8em;
    opacity: 0.8;
    margin-right: 5px;
    color: var(--text-on-glass);
}

.soap-content {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-on-glass);
    opacity: 0.9;
}
.soap-content p { /* Style paragraphs within SOAP content */
    margin-bottom: 0.5em;
}
.soap-content ul { /* Style lists within SOAP content */
    list-style-type: disc;
    padding-right: 20px;
    margin-bottom: 0.5em;
}
.soap-content li {
    margin-bottom: 0.3em;
}


/* Audio Player Card */
.audio-player-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    width: 100%;
}

.audio-play-button {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--audio-play-normal); /* Transparent white */
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.audio-play-button .audio-icon {
    width: 24px;
    height: 24px;
    color: #fff;
    stroke-width: 2;
}

.audio-play-button:hover {
    background-color: var(--audio-play-hover); /* Greenish transparent on hover */
    box-shadow: 0 0 15px var(--audio-glow-green); /* Green glow on hover */
    transform: scale(1.05);
}

.audio-play-button.is-playing {
    background-color: var(--audio-play-active); /* Solid green when playing */
    border-color: rgba(39, 174, 96, 0.9);
    box-shadow: 0 0 20px var(--audio-glow-green), 0 0 30px rgba(39, 174, 96, 0.7); /* Stronger glow when playing */
    transform: scale(1.0); /* Reset scale when playing to avoid jumpiness */
}

.audio-status {
    font-size: 0.9em;
    opacity: 0.8;
    color: var(--text-on-glass);
    flex-grow: 1;
    text-align: right;
}

/* Doctor's Actions Grid */
.doctor-actions-main-card {
    padding: 0;
}

.doctor-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjusted min-width for action cards */
    gap: 20px;
    padding: 20px;
}

.doctor-action-card {
    background: rgba(255, 255, 255, 0.05); /* Lighter background for inner cards */
    backdrop-filter: blur(20px); /* Adjusted blur for inner cards */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15); /* Lighter border for inner cards */
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.3), 0 0 10px rgba(134, 68, 11, 0.2); /* Adjusted shadow/glow */
    padding: 15px;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.doctor-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 rgba(0, 0, 0, 0.4), 0 0 15px rgba(134, 68, 11, 0.3);
}

.action-header {
    font-size: 1.1em;
    color: var(--card-bg-tone);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
    display: block;
}

.form-control-with-button {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.form-control-with-button textarea {
    flex-grow: 1;
    height: auto;
    min-height: 100px; /* Minimum height for textareas */
}

.form-control-with-button .button {
    flex-shrink: 0;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
}

.form-buttons-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    padding: 0 20px;
}

.landing-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -2; /* Behind the main background overlay */
    overflow: hidden;
}
.landing-background-video {
    width: 100vw;
    height: 100vh;
    object-fit: cover; /* Ensures video covers the screen without distortion */
    filter: brightness(0.6); /* Darkens the video to make text readable */
}
/* On pages other than landing, use the static background */
body:not(:has(.landing-video-container)) .background-container {
    display: block; /* The original static background */
}
/* Hide the static background on the landing page */
body:has(.landing-video-container) .background-container {
    display: none;
}


/* 2. Loading Animations */
.hidden-for-anim {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.hidden-for-anim.animate-in {
    opacity: 1;
    transform: translateY(0);
}


/* 3. Company Logo */
.logo-container {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 100;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.logo-container:hover {
    transform: scale(1.08);
}
.company-logo {
    width: 80px; /* Adjust size as needed */
    height: auto;
    opacity: 0.85;
}


/* 4. "About Us" Modal Enhancements */
#about-us-modal .modal-content {
    max-width: 550px; /* Optimal width for reading */
    text-align: right;
}
#about-us-modal h2 {
    color: var(--card-bg-tone);
    text-align: center;
}
#about-us-modal p {
    line-height: 1.8;
    opacity: 0.9;
}

.button, input[type="submit"] {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    color: #f0f0f0;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

/* Button Hover Glow & Animation */
.button:hover, input[type="submit"]:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Button Color Variants */
.button.accent, input[type="submit"] {
    background: rgba(134, 68, 11, 0.4); /* --accent */
    border-color: rgba(134, 68, 11, 0.8);
}
.button.accent:hover, input[type="submit"]:hover {
    background: rgba(134, 68, 11, 0.6);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(134, 68, 11, 0.5); /* Glow Effect */
}

.button.primary {
    background: rgba(126, 123, 99, 0.4); /* --primary */
    border-color: rgba(126, 123, 99, 0.8);
}
.button.primary:hover {
    background: rgba(126, 123, 99, 0.6);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(126, 123, 99, 0.5); /* Glow Effect */
}

.button.danger {
    background: rgba(192, 57, 43, 0.4); /* A red color */
    border-color: rgba(192, 57, 43, 0.8);
}
.button.danger:hover {
    background: rgba(192, 57, 43, 0.6);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(192, 57, 43, 0.5); /* Glow Effect */
}

/* Adapt entry cards on landing to use the button style */
.entry-card.button {
    width: 280px;
    text-align: center;
    padding: 20px;
}


/* 2. Graphical Info Card (Clock & Tip) */
.info-card {
    position: absolute;
    top: 25px;
    left: 35px;
    z-index: 100;
    width: 280px;
    padding: 15px;
}

.graphical-clock .time {
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.graphical-clock .date-container {
    display: flex;
    justify-content: space-between;
    margin-top: -5px;
    padding: 0 5px;
}

.graphical-clock .date {
    font-size: 0.9em;
    opacity: 0.8;
}

.health-tip {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-tip .tip-icon {
    width: 20px;
    height: 20px;
    color: var(--card-bg-tone);
    flex-shrink: 0;
}

.health-tip p {
    font-size: 0.85em;
    line-height: 1.6;
    opacity: 0.9;
}

/* Hide the old clock on the landing page */
body.page-index #global-clock {
    display: none;
}

.step-container {
    display: flex;
    gap: 25px;
    margin-top: 25px;
    align-items: flex-start; /* Align tiles to the top */
}

.consultation-step-card {
    flex: 1; /* Each tile takes equal space */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 25px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.step-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    flex-shrink: 0;
}

.step-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.step-description {
    font-size: 0.9em;
    opacity: 0.8;
    min-height: 50px; /* Ensures cards have similar height */
}

/* 2. New Record Button Style */
.record-area {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.record-button-new {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
}

.record-button-new .record-icon {
    width: 36px;
    height: 36px;
    color: #fff;
    transition: all 0.3s ease;
}

.record-button-new:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.15);
    /* The shining green halo */
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.6), 0 5px 25px rgba(0,0,0,0.3);
}

.record-button-new.is-recording {
    background: rgba(46, 204, 113, 0.2); /* Transparent shining green */
    border-color: rgba(46, 204, 113, 0.8);
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.8), 0 5px 25px rgba(0,0,0,0.3); /* Intense green glow */
    animation: pulse-green 1.5s infinite;
}
@keyframes pulse-green {
    0% { box-shadow: 0 0 30px rgba(46, 204, 113, 0.4), 0 5px 25px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 0 40px rgba(46, 204, 113, 0.8), 0 5px 25px rgba(0,0,0,0.3); }
    100% { box-shadow: 0 0 30px rgba(46, 204, 113, 0.4), 0 5px 25px rgba(0,0,0,0.3); }
}

.audio-status-new {
    font-size: 0.9em;
    opacity: 0.8;
}

.audio-playback-new {
    width: 100%;
    margin-top: 15px;
    display: none; /* Hidden by default */
}

/* 3. New File Upload and Submit Button Styles */
.upload-button {
    margin: 20px 0;
}
.file-list-new {
    width: 100%;
    font-size: 0.85em;
    text-align: right;
}
.file-list-new .file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
    margin-bottom: 5px;
}
.submit-button-new {
    margin-top: 20px;
    width: 100%;
}
.final-status-new {
    margin-top: 10px;
    font-size: 0.9em;
    opacity: 0.8;
}

/* 4. Doctor's Page: Document Viewer & Lightbox */
.document-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    padding: 15px;
}

.thumbnail-item {
    width: 100%;
    aspect-ratio: 1 / 1; /* Make them square */
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.2);
}
.thumbnail-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--glow-color);
}
.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.file-icon-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-on-glass);
    opacity: 0.7;
}

/* Lightbox styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.4s ease;
}
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}
.lightbox-close:hover {
    color: #bbb;
}

.detail-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    grid-template-rows: auto;
    gap: 25px;
    grid-template-areas:
        "assistant media"
        "soap      soap"
        "doctor    doctor";
}

/* Assigning grid areas */
.grid-item-assistant { grid-area: assistant; }
.grid-item-media { grid-area: media; }
.grid-item-soap { grid-area: soap; }
.grid-item-doctor { grid-area: doctor; }

/* Styling for the media column (audio and docs) */
.grid-item-media {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Small text for timestamp in doctor's action card */
.timestamp-text {
    opacity: 0.7;
    font-size: 0.9em;
    padding: 0 20px 15px;
    text-align: left;
    margin-top: -10px; /* Pull it closer to the form */
}


/* Responsive adjustments for smaller screens */
@media (max-width: 900px) {
    .detail-grid-container {
        grid-template-columns: 1fr; /* Single column */
        grid-template-areas:
            "assistant"
            "media"
            "soap"
            "doctor";
    }
}

#follow-up-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
}

#follow-up-controls p {
    margin: 0;
    font-size: 1.1em;
}

/* Follow-up History Tile */
.follow-up-history {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.follow-up-item {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary);
}
.follow-up-item:last-child {
    margin-bottom: 0;
}

.fu-date {
    font-size: 0.9em;
    opacity: 0.7;
    margin-bottom: 10px;
}

.fu-prompt, .fu-response {
    margin-bottom: 8px;
}

.fu-analysis {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.9em;
}
.fu-analysis p {
    opacity: 0.9;
    line-height: 1.7;
}

.dashboard-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 25px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .dashboard-actions-grid {
        grid-template-columns: 1fr; /* Single column on smaller screens */
    }
}

.dynamic-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.dynamic-form-row input {
    flex-grow: 1;
}

.remove-btn {
    padding: 5px 10px;
    line-height: 1;
    font-weight: bold;
    flex-shrink: 0;
}

.doctor-only {
    display: none !important;
}

@media (max-width: 768px) {
    /* --- ۱. بهبودهای عمومی --- */
    h1, .page-title {
        font-size: 1.8em;
    }
    h2 {
        font-size: 1.5em;
    }
    h3 {
        font-size: 1.2em;
    }
    .main-content {
        padding: 20px 15px;
    }
    .card {
        padding: 15px;
    }
    .wizard-content {
        padding: 20px 15px;
    }
    .login-card {
        padding: 25px;
    }

    /* --- ۲. اصلاحات صفحه فرود (Landing Page) --- */
    .info-card {
 	width: 240px; /* کاهش عرض کلی ویجت */
        padding: 12px; /* کاهش فاصله داخلی */
        left: 15px;   /* تنظیم فاصله از لبه‌ها */
    	top: 15px;
    }
    .graphical-clock .time {
    	font-size: 2em; /* کوچک کردن فونت ساعت */
    	letter-spacing: 1px;
    }
    .graphical-clock .date {
    	font-size: 0.8em; /* کوچک کردن فونت تاریخ */
    }
    .health-tip {
    	margin-top: 10px;
    	gap: 8px;
    }
    .health-tip p {
    	font-size: 0.8em; /* کوچک کردن متن پیام سلامتی */
    	line-height: 1.5;
    }
    .health-tip .tip-icon {
    	width: 18px; /* کوچک کردن آیکون */
    	height: 18px;
    }
    .landing-hero {
        margin-top: 15vh;
    }
    .landing-title {
        font-size: 2em;
    }
    .landing-subtitle {
        font-size: 0.9em;
    }
    .integrated-carousel-container {
        height: 180px;
    }
    .main-slide {
        width: 220px;
        height: 140px;
    }
    .main-slide h2 {
        font-size: 1em;
    }
    .main-slide p {
        font-size: 0.7em;
    }
    .main-slide i {
        width: 28px;
        height: 28px;
        margin-bottom: 8px;
    }
    .neo-showcase {
        padding-top: 3vh;
        padding-bottom: 3vh;
    }
    .neo-main-logo {
        height: 30px;
    }
    .neo-subtitle {
        font-size: 0.8em;
        letter-spacing: 4px;
    }
    .neo-icon {
        width: 28px;
        height: 28px;
    }

    /* --- ۳. اصلاحات داشبورد اصلی (dashboard.html) --- */
    .card-header > div[style*="display: flex"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    div[style*="align-items: center; gap: 15px;"] {
        flex-direction: column;
        align-items: stretch;
    }
    div[style*="align-items: center; gap: 15px;"] a.button {
        width: 100%;
        text-align: center;
    }

    /* --- ۴. اصلاحات صفحات داخلی (جزئیات بیمار، مراجعه و...) --- */
    .page-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .soap-grid {
        grid-template-columns: 1fr;
    }
    .consultation-grid-small {
        grid-template-columns: 1fr;
    }
    .patient-detail-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-actions-grid {
        grid-template-columns: 1fr;
    }
    .detail-grid-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "assistant"
            "media"
            "soap"
            "doctor";
    }
}

@media (max-width: 768px) {
    .info-card {
        display: none !important;
    }
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-text {
    padding: 10px 18px;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75em;
    opacity: 0.6;
    padding: 0 10px 5px 10px;
    align-self: flex-end; /* کلید اصلی برای قرارگیری در گوشه پایین */
}

.user-message .message-time {
    align-self: flex-start;
}

.date-separator {
    text-align: center;
    margin: 15px auto;
    padding: 5px 15px;
    background-color: rgba(40, 40, 40, 0.7);
    border-radius: 20px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
}

/* استایل‌های جدید برای لیست جلسات گفتگو */
.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.session-date {
    font-size: 0.8em;
    opacity: 0.7;
    flex-shrink: 0;
    margin-right: 10px; /* فاصله از عنوان */
}

body.page-chat_page .top-left-home-link {
    display: none;
}

.chat-action-button {
    display: block; /* Takes the full width of the message bubble */
    text-decoration: none;
    padding: 14px 25px;
    margin-top: 20px;
    border-radius: 12px;
    font-weight: bold;
    font-family: var(--font-persian);
    color: #fff;
    text-align: center;
    
    /* Glassmorphism Effect using your theme's variables */
    background: rgba(134, 68, 11, 0.4); /* --accent color with transparency */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(134, 68, 11, 0.8); /* Solid Accent border */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    
    /* Interaction */
    transition: all 0.3s ease;
}

.chat-action-button:hover {
    transform: translateY(-3px);
    background: rgba(134, 68, 11, 0.6);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 25px rgba(134, 68, 11, 0.5); /* Glow effect */
    color: #fff;
}

.chat-action-button .feather {
    vertical-align: middle;
    margin-left: 8px;
    width: 20px;
    height: 20px;
}

#enamad-badge-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 998;
    transition: transform 0.3s ease;
}

#enamad-badge-container a {
    display: block;
    width: 85px;  /* اندازه تصویر */
    height: auto;
    
    /* حذف تمام استایل‌های شیشه‌ای */
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
}

#enamad-badge-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* تغییر به contain تا کل لوگو دیده شود */
    opacity: 0.9; /* کمی شفافیت برای زیبایی، در هاور کامل می‌شود */
    transition: all 0.3s ease;
    cursor: pointer;
}

/* فقط افکت بزرگ‌نمایی در هنگام موس‌اُور */
#enamad-badge-container a:hover {
    transform: scale(1.1);
    background: transparent;
    box-shadow: none;
    border: none;
}

#enamad-badge-container a:hover img {
    opacity: 1;
}

/* استایل ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    #enamad-badge-container {
        bottom: 15px;
        right: 15px;
    }
    #enamad-badge-container a {
        width: 65px;
        height: 65px;
        border-radius: 12px;
    }
    /* غیرفعال کردن انیمیشن پیچیده در موبایل برای پرفورمنس بهتر */
    #enamad-badge-container a:hover {
        transform: scale(1.1);
    }
}

.chat-cta-card-wrapper {
    width: 100%;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.chat-cta-card {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 25px 30px;

    /* Glassmorphism Effect */
    background: rgba(30, 30, 30, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-cta-card .cta-icon-wrapper {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
}

.chat-cta-card .cta-icon-wrapper .feather {
    width: 30px;
    height: 30px;
    color: var(--accent);
}

.chat-cta-card h3 {
    font-size: 1.4em;
    color: #fff;
    margin-bottom: 10px;
}

.chat-cta-card p {
    font-size: 0.95em;
    opacity: 0.8;
    line-height: 1.7;
    margin-bottom: 25px;
}

.cta-button {
    display: block;
    width: 100%;
    padding: 14px;
    text-decoration: none;
    font-weight: bold;
    color: #fff;
    border-radius: 12px;
    position: relative;
    overflow: hidden; /* Important for the shimmer effect */

    /* Glassmorphism for the button */
    background: rgba(134, 68, 11, 0.5); /* --accent */
    border: 1px solid rgba(134, 68, 11, 0.8);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(134, 68, 11, 0.5);
}

/* Shimmer Effect on Hover */
.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 75%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: left 0.7s ease-in-out;
}

.cta-button:hover::before {
    left: 120%;
}

.cta-button span, .cta-button .feather {
    position: relative; /* Ensure text/icon is above the shimmer */
    z-index: 1;
    vertical-align: middle;
}

.cta-button .feather {
    margin-right: 8px;
    width: 20px;
}
