/* ==========================================================
   UAE Hospital Queuing & Patient Management System
   Premium "Emirati Royal Medical" Stylesheet
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Noto+Kufi+Arabic:wght@400;600;700&family=Open+Sans:wght@300;400;600&display=swap');

:root {
    --primary: #005B60;          /* Deep Medical Teal */
    --primary-light: #00848A;    /* Soft Teal */
    --primary-dark: #003B3E;     /* Royal Dark Teal */
    --primary-rgb: 0, 91, 96;
    
    --accent: #C5A880;           /* Luxurious Brass/Gold */
    --accent-light: #DFCDA9;     /* Light Cream Gold */
    --accent-dark: #9C7E55;      /* Rich Bronze Gold */
    
    --bg-light: #F6F8F8;         /* Warm Ivory/Clinical Light */
    --bg-dark: #0B1212;          /* Luxury Dark Mode Base */
    
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(197, 168, 128, 0.2);
    
    --text-dark: #1F2829;        /* Deep Charcoal */
    --text-light: #E3E9E9;       /* Soft White */
    --text-muted: #6C7A7C;       /* Warm Gray */
    
    --emergency: #D9383A;        /* Urgent Red */
    --vip: #8A30B0;             /* Royal Purple */
    --success: #2E8B57;          /* Sea Green */
    --warning: #E0A924;          /* Warm Yellow */
    
    --shadow: 0 8px 30px rgba(0, 48, 51, 0.08);
    --shadow-accent: 0 10px 30px rgba(197, 168, 128, 0.15);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Open Sans', 'Noto Kufi+Arabic', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', 'Noto Kufi Arabic', sans-serif;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ==========================================================
   Header & Premium Branding
   ========================================================== */

header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--text-light);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid var(--accent);
    position: relative;
    z-index: 100;
}

header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #fff 60%, var(--accent-light));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.brand-logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.brand-text h1 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--accent-light);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    border: 1px solid rgba(197, 168, 128, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-tag i {
    color: var(--accent);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent-light);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--accent);
    color: var(--primary-dark);
    box-shadow: 0 0 10px rgba(197, 168, 128, 0.4);
}

/* ==========================================================
   Common Layouts & Containers
   ========================================================== */

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.grid-dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .grid-dashboard {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 48, 51, 0.12);
}

.card-header-styled {
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-styled h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header-styled h2 i {
    color: var(--primary);
}

/* ==========================================================
   UI Interactive Elements (Buttons, Inputs)
   ========================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1.5px solid #D5DFE0;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #FFF;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 96, 0.15);
}

.btn-primary-styled {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #FFF;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 91, 96, 0.2);
}

.btn-primary-styled:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 91, 96, 0.3);
    filter: brightness(1.1);
}

.btn-accent-styled {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--primary-dark);
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(197, 168, 128, 0.2);
}

.btn-accent-styled:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(197, 168, 128, 0.35);
}

.btn-danger-styled {
    background: linear-gradient(135deg, var(--emergency), #B71C1C);
    color: #FFF;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-danger-styled:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ==========================================================
   Landing Portal Styles
   ========================================================== */

.landing-hero {
    text-align: center;
    padding: 4rem 2rem;
    background: radial-gradient(circle at top, rgba(197, 168, 128, 0.1), transparent);
    border-radius: 20px;
    margin-bottom: 3rem;
}

.landing-hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.landing-hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0.5rem auto 2rem;
}

.grid-portals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    padding: 1rem 0;
}

.portal-card {
    background: white;
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--accent);
    transition: var(--transition);
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-accent);
    border-color: var(--accent);
}

.portal-card:hover::before {
    height: 8px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
}

.portal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 91, 96, 0.05);
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.portal-card:hover .portal-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.portal-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.portal-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================
   Triage/Reception Portal Elements
   ========================================================== */

.patient-search-results {
    background: #FFF;
    border: 1px solid #E3E9E9;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.patient-badge-vip {
    background: linear-gradient(135deg, var(--vip), #6A1B9A);
    color: #FFF;
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.ticket-print-area {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Animated Queue Ticket Layout */
.queue-ticket-print {
    width: 320px;
    background: #FFF;
    border: 1px solid #DDD;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    animation: printSlip 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    transform-origin: top center;
}

@keyframes printSlip {
    0% { transform: scaleY(0); opacity: 0; }
    100% { transform: scaleY(1); opacity: 1; }
}

.ticket-header {
    text-align: center;
    border-bottom: 2px dashed var(--accent-light);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.ticket-header img.logo-sim {
    height: 40px;
    margin-bottom: 0.5rem;
}

.ticket-header h4 {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.ticket-body {
    text-align: center;
    padding: 1rem 0;
}

.ticket-num {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 0.5rem 0;
    letter-spacing: 1px;
}

.ticket-priority-tag {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.ticket-priority-tag.Normal {
    background: #E8F5E9;
    color: #2E7D32;
}

.ticket-priority-tag.VIP {
    background: #F3E5F5;
    color: var(--vip);
}

.ticket-priority-tag.Emergency {
    background: #FFEBEE;
    color: var(--emergency);
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0.4; }
}

.ticket-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px dashed #DDD;
    padding-top: 1rem;
}

.ticket-qr {
    width: 80px;
    height: 80px;
    margin: 0.5rem auto;
    border: 1px solid #EEE;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: #444;
}

/* ==========================================================
   Queue Display Board (TV Dashboard) - Fullscreen Mode
   ========================================================== */

.display-body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.display-header {
    background: linear-gradient(90deg, #072224, #003B3E, #072224);
    border-bottom: 3px solid var(--accent);
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 12%;
}

.display-time-widget {
    text-align: right;
}

.display-time-widget h2 {
    color: #FFF;
    font-size: 1.8rem;
    font-weight: 800;
}

.display-time-widget p {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.display-main {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr;
    height: 88%;
}

@media (max-width: 900px) {
    .display-main {
        grid-template-columns: 1fr;
    }
}

.display-board {
    background: radial-gradient(circle at center, #0F2021 0%, #050A0B 100%);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.display-board-title {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid rgba(197, 168, 128, 0.3);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.display-board-title h3 {
    color: var(--accent-light);
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.display-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.display-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(197, 168, 128, 0.15);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.display-card.calling {
    background: linear-gradient(135deg, rgba(0, 91, 96, 0.3), rgba(197, 168, 128, 0.1));
    border: 2px solid var(--accent);
    box-shadow: 0 0 25px rgba(197, 168, 128, 0.25);
    animation: activeCallFlash 1.5s infinite alternate;
}

@keyframes activeCallFlash {
    0% { border-color: rgba(197, 168, 128, 0.4); box-shadow: 0 0 10px rgba(197, 168, 128, 0.1); }
    100% { border-color: var(--accent); box-shadow: 0 0 30px rgba(197, 168, 128, 0.4); }
}

.display-card-left {
    display: flex;
    flex-direction: column;
}

.display-ticket-num {
    font-size: 3.5rem;
    font-weight: 800;
    color: #FFF;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
}

.display-card.calling .display-ticket-num {
    color: var(--accent-light);
}

.display-dept-name {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.5rem;
}

.display-card.calling .display-dept-name {
    color: #E3E9E9;
}

.display-room-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--primary-dark);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    min-width: 120px;
}

.display-room-badge span {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    display: block;
    letter-spacing: 1px;
}

.display-room-badge h3 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    color: var(--primary-dark);
}

.display-sidebar {
    background-color: #060A0A;
    border-left: 2px solid rgba(197, 168, 128, 0.2);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.weather-prayer-panel {
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 2rem;
}

.weather-prayer-panel h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(197, 168, 128, 0.2);
    padding-bottom: 0.5rem;
}

.panel-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.panel-row span:last-child {
    font-weight: 700;
    color: #FFF;
}

.health-tips-panel {
    flex: 1;
    background: rgba(0, 91, 96, 0.15);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(0, 91, 96, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.health-tips-panel::after {
    content: '\f21e';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.02);
}

.tip-content h4 {
    color: var(--accent-light);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.tip-content p {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* ==========================================================
   Doctor Console Layout
   ========================================================== */

.doctor-dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .doctor-dashboard {
        grid-template-columns: 1fr;
    }
}

.active-patient-card {
    background: linear-gradient(135deg, #FFF, #F0F5F5);
    border-left: 5px solid var(--accent);
}

.active-patient-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.patient-info-box {
    background: rgba(0, 91, 96, 0.03);
    border: 1px solid #E3E9E9;
    padding: 1rem;
    border-radius: 8px;
}

.patient-info-box span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    text-transform: uppercase;
}

.patient-info-box h4 {
    font-size: 1.1rem;
    margin-top: 0.25rem;
}

.doctor-actions-row {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pending-queue-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pending-queue-item {
    background: white;
    border: 1px solid #E3E9E9;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.pending-queue-item:hover {
    border-color: var(--primary-light);
}

.pending-left {
    display: flex;
    flex-direction: column;
}

.pending-ticket-badge {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.1rem;
}

.pending-patient-name {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.pending-priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.pending-priority-dot.Normal { background: var(--success); }
.pending-priority-dot.VIP { background: var(--vip); }
.pending-priority-dot.Emergency { background: var(--emergency); }

/* ==========================================================
   Overlay Notification (Popups)
   ========================================================== */

.overlay-calling-notification {
    position: fixed;
    top: 5%;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    width: 600px;
    background: linear-gradient(135deg, var(--primary-dark), #002224);
    border: 3px solid var(--accent);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    z-index: 1000;
    padding: 2rem;
    text-align: center;
    color: #FFF;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay-calling-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.overlay-title {
    font-size: 1.5rem;
    color: var(--accent-light);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.overlay-ticket {
    font-size: 4rem;
    font-weight: 800;
    margin: 1rem 0;
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--accent);
}

.overlay-room {
    font-size: 1.8rem;
    font-weight: 600;
}

.overlay-room span {
    color: var(--accent);
}

/* ==========================================================
   Login Styling
   ========================================================== */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.5rem;
}

.login-card {
    background: #FFF;
    border-radius: var(--radius);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-top: 5px solid var(--accent);
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: rgba(0, 91, 96, 0.05);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    margin: 0 auto 1.5rem;
    border: 2px solid var(--accent-light);
}

.login-card h2 {
    margin-bottom: 0.5rem;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
