@font-face {
    font-family: 'GreatVibes';
    src: url('GreatVibes-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ananda';
    src: url('Ananda Black Personal Use.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'FeFCrm2';
    src: url('FeFCrm2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Healthcare Professional Color Palette */
    --primary: #1a6bb3;
    --primary-light: #4a90e2;
    --primary-dark: #0d4d8c;
    --secondary: #2ecc71;
    --accent: #3498db;
    --teal: #1abc9c;
    --light-blue: #e8f4fd;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    
    /* Clinic Specific Colors */
    --stethoscope: #16a085;
    --medicine: #9b59b6;
    --lab: #e67e22;
    --radiology: #e74c3c;
    --pharmacy: #2980b9;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border radius */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);
    --shadow-sidebar: 3px 0 15px rgba(0,0,0,0.1);
}

/* Main PHP Body Styles */
#main-php-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light-blue) 0%, #ffffff 100%);
    overflow-x: hidden;
    margin: 0;
    display: flex;
    flex-direction: row;
    height: 100vh;
}

/* Left Frame (Sidebar) - Enhanced for Clinic Theme */
.left-frame {
    flex: 0 0 280px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.left-frame.collapsed {
    flex: 0 0 70px;
}

.left-frame.collapsed .sidebar-content,
.left-frame.collapsed .user-details,
.left-frame.collapsed .sidebar-footer,
.left-frame.collapsed .sidebar-logo span,
.left-frame.collapsed .sidebar-header small {
    display: none;
}

/* Toggle Button */
.toggle-button {
    position: absolute;
    top: 20px;
    right: -15px;
    background: var(--teal);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1010;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.toggle-button:hover {
    background: var(--secondary);
    transform: scale(1.1);
}

/* Sidebar Styles */
.sidebar-header {
    padding: var(--spacing-lg);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.sidebar-logo i {
    color: var(--teal);
    font-size: 1.75rem;
}

.sidebar-header small {
    font-size: 0.85rem;
    opacity: 0.9;
}

.user-info {
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.user-role {
    display: inline-block;
    background: var(--teal);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.sidebar-content {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.sidebar-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--border-radius-lg);
    background: white;
    box-shadow: var(--shadow-sm);
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.clinic-hours {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Main Frame */
.main-frame {
    flex: 1;
    background: var(--light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    height: 80px;
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 0 var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.page-title i {
    color: var(--primary);
}

.clinic-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--gray-600);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.status-indicator.active {
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.action-item {
    position: relative;
}

.btn-notification, .btn-help {
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    position: relative;
}

.btn-notification:hover, .btn-help:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.notification-badge {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    position: absolute;
    top: 5px;
    right: 5px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.user-greeting {
    color: var(--gray-600);
    font-weight: 500;
}

.btn-logout {
    background: var(--primary);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 500;
}

.btn-logout:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.content-area {
    flex: 1;
    padding: var(--spacing-xl);
    background: var(--light-blue);
}

.content-area iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
    background: white;
}

/* Enhanced General Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--gray-100);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

img.responsive {
    width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

a.white {
    color: white;
}

a.white:hover {
    color: white;
    opacity: 0.9;
}

/* Cards with Medical Theme */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid var(--primary);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card.medical {
    border-left-color: var(--stethoscope);
}

.card.lab {
    border-left-color: var(--lab);
}

.card.pharmacy {
    border-left-color: var(--pharmacy);
}

/* Window/Popup styles */
.window {
    max-width: 780px;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-xl);
    text-align: center;
    margin: auto;
    background-color: white;
    box-shadow: var(--shadow-lg);
    font-size: 1.1rem;
    border-top: 4px solid var(--primary);
}

#mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

#mask.showing {
    opacity: 1;
    visibility: visible;
}

#boxes {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inner {
    padding: var(--spacing-xl);
}

#popupfoot {
    font-size: 1rem;
    margin-top: var(--spacing-lg);
}

.showImage {
    margin: 0 0 var(--spacing-xl);
    text-align: center;
}

.showImage img {
    max-width: 100%;
    border-radius: var(--border-radius-md);
}

/* Typography */
.wong {
    font-family: 'GreatVibes', cursive;
    font-size: 1.5rem;
    color: var(--primary);
}

.heading {
    font-size: 1.75rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--secondary);
}

.foot {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.data {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

/* Enhanced Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--gray-300);
}

.odd {
    background-color: rgba(26, 107, 179, 0.05);
}

.even {
    background-color: white;
}

.table tr:hover {
    background-color: rgba(26, 107, 179, 0.08);
}

/* Enhanced Buttons */
.buttons {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.buttons:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.buttons:active {
    transform: translateY(0);
}

.buttons_links {
    display: inline-block;
    font-weight: 600;
    background: var(--primary);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.buttons_links:hover {
    background: var(--primary-dark);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Forms */
.forms_boxes {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.forms_boxes:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 107, 179, 0.25);
}

/* Utility classes */
.error {
    background: linear-gradient(135deg, var(--danger) 0%, #c0392b 100%);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin: var(--spacing-md) 0;
    text-align: center;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.success {
    background: linear-gradient(135deg, var(--success) 0%, #229954 100%);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin: var(--spacing-md) 0;
    text-align: center;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #e67e22 100%);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin: var(--spacing-md) 0;
    text-align: center;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.borders {
    border: 1px dashed var(--gray-300);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
}

.instructions {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-sm);
}

/* Enhanced Prescription styles */
.rx_title {
    font-weight: 700;
    color: var(--dark);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--spacing-sm);
}

.rx_titlenew {
    font-weight: 700;
    color: var(--dark);
    background-color: var(--gray-300);
    padding: var(--spacing-sm);
}

.rx_even {
    color: var(--dark);
    background: var(--gray-100);
}

.rx_odd {
    color: var(--dark);
    background: var(--gray-200);
}

.rx_print_title {
    font-weight: 700;
    font-size: 1.1rem;
}

.rx_print_title_med {
    font-weight: 700;
    font-size: 1.25rem;
}

.rx_print_title2 {
    font-weight: 700;
    font-size: 1rem;
}

.rx_print_title3 {
    font-size: 0.9rem;
}

.rx_print_data {
    font-weight: 400;
}

.rx_print_data2 {
    font-weight: 400;
    font-style: italic;
}

.rx_print_data3 {
    font-size: 0.85rem;
    font-weight: 400;
}

.rx_print_data_med {
    font-size: 1rem;
    line-height: 1.5;
}

/* Paging */
.paging {
    padding: var(--spacing-md) 0;
    background: white;
    color: var(--gray-600);
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.paging a {
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--primary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.paging a:hover {
    background-color: var(--primary);
    color: white;
    text-decoration: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #main-php-body {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .left-frame {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
    }
    
    .left-frame.collapsed {
        flex: 0 0 70px;
        height: 70px;
    }
    
    .main-frame {
        flex: 1;
    }
    
    .toggle-button {
        top: 15px;
        right: 15px;
    }
    
    .header {
        padding: 0 var(--spacing-md);
        height: 70px;
    }
    
    .header-left {
        gap: var(--spacing-md);
    }
    
    .page-title span {
        font-size: 1.25rem;
    }
    
    .user-greeting {
        display: none;
    }
    
    .content-area {
        padding: var(--spacing-md);
    }
    
    body {
        font-size: 14px;
    }
    
    .nav {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .nav-menu {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .window {
        padding: var(--spacing-md);
        margin: var(--spacing-md);
    }
    
    .table {
        display: block;
        overflow-x: auto;
    }
}

@media print {
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
    
    .card, .window {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .buttons, .buttons_links {
        display: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* Add these to your existing CSS */
.capacity-info {
    transition: all 0.3s ease;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure the capacity info is properly styled when showing/hiding */
.capacity-info[style*="display: block"] {
    display: flex !important;
    flex-direction: column;
}