/* Hemsire CRM Premium CSS Stylesheet */

/* Design Tokens & Theme Variables */
:root {
    /* Colors - Dark Theme (Default) */
    --bg-color: #0b1120;
    --sidebar-bg: #070c18;
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    
    /* Brand Colors */
    --primary-color: #0d9488; /* Teal */
    --primary-hover: #0f766e;
    --secondary-color: #0ea5e9; /* Sky Blue */
    
    /* Status Colors */
    --status-free: #10b981; /* Green */
    --status-assigned: #3b82f6; /* Blue */
    --status-pending: #f59e0b; /* Yellow */
    --status-cancelled: #ef4444; /* Red */
    --status-passive: #64748b; /* Gray */
    --status-blacklist: #881337; /* Dark Red */

    --bg-darker: #050810;
    --font-family: 'Outfit', sans-serif;
    --transition-speed: 0.3s;
}

/* Light Theme Variables */
body.light-theme {
    --bg-color: #f1f5f9;
    --sidebar-bg: #0f172a; /* Keep sidebar dark for professional contrast */
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.06);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-color: #1e293b;
    --text-muted: #64748b;
    --bg-darker: #e2e8f0;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
aside.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 50;
    shrink-0: 1;
    transition: width var(--transition-speed) ease;
}

.sidebar-logo {
    height: 80px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(13, 148, 136, 0.15);
    border: 1px solid rgba(13, 148, 136, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon i {
    color: var(--primary-color);
    width: 24px;
    height: 24px;
}

.logo-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.logo-text span {
    color: var(--primary-color);
}

.logo-text p {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    background: rgba(13, 148, 136, 0.12);
    color: #fff;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.nav-link i {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-t: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-cover: cover;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    color: var(--status-cancelled);
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
main.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

/* Header Styles */
header.top-header {
    height: 80px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(8px);
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-title p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-theme-toggle {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Content Container */
.content-body {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background-color: var(--bg-darker);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Glassmorphism Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card.blue::before { background: var(--status-assigned); }
.stat-card.yellow::before { background: var(--status-pending); }
.stat-card.red::before { background: var(--status-cancelled); }

.stat-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-info .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card.blue .stat-icon { background: rgba(59, 130, 246, 0.1); color: var(--status-assigned); }
.stat-card.yellow .stat-icon { background: rgba(245, 158, 11, 0.1); color: var(--status-pending); }
.stat-card.red .stat-icon { background: rgba(239, 104, 104, 0.1); color: var(--status-cancelled); }

/* Standard Section Layout */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.3);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Tables & Lists */
.data-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table.data-table th {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

table.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
    vertical-align: middle;
}

table.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.status-active, .badge.available {
    background: rgba(16, 185, 129, 0.12);
    color: var(--status-free);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge.status-passive {
    background: rgba(100, 116, 139, 0.12);
    color: var(--status-passive);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.badge.status-blacklist {
    background: rgba(239, 68, 68, 0.12);
    color: var(--status-cancelled);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge.status-assigned {
    background: rgba(59, 130, 246, 0.12);
    color: var(--status-assigned);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--status-pending);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Form Controls & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.filter-item {
    flex: 1;
    min-width: 150px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background: var(--sidebar-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}

.btn-close-modal:hover {
    color: var(--status-cancelled);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Tags / Skills List */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-badge button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.tag-badge button:hover {
    color: var(--status-cancelled);
}

/* Availability Grid View */
.availability-grid-container {
    display: grid;
    grid-template-columns: 220px 1fr;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.grid-left-col {
    background: rgba(0, 0, 0, 0.15);
    border-right: 1px solid var(--border-color);
}

.grid-cell-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.grid-nurse-row {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-weight: 500;
}

.grid-right-scroll {
    overflow-x: auto;
}

.grid-days-row {
    display: flex;
    height: 60px;
    border-bottom: 1px solid var(--border-color);
}

.grid-day-header {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 1px solid var(--border-color);
    text-align: center;
}

.grid-day-header .day-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.grid-day-header .day-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.grid-nurse-days-row {
    display: flex;
    height: 80px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.grid-day-cell {
    flex: 1;
    min-width: 140px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: rgba(0,0,0,0.05);
}

.grid-day-cell.free {
    background: rgba(16, 185, 129, 0.03);
}

.grid-day-cell.assigned {
    background: rgba(59, 130, 246, 0.03);
}

.grid-day-cell.unavailable {
    background: rgba(100, 116, 139, 0.03);
}

.grid-slot-block {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    text-align: center;
}

.grid-slot-block.free {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-free);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.grid-slot-block.assigned {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-assigned);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.grid-slot-block.unavailable {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.grid-slot-block.not-set {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}

/* Calendar Screen */
.calendar-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.calendar-grid {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-cell {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 90px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day-cell:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--primary-color);
}

.calendar-day-cell.active-day {
    background: rgba(13, 148, 136, 0.05);
    border-color: var(--primary-color);
}

.calendar-day-cell.other-month {
    opacity: 0.3;
    pointer-events: none;
}

.calendar-day-num {
    font-weight: 600;
    font-size: 0.95rem;
}

.calendar-day-badge {
    background: var(--primary-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    align-self: flex-end;
}

/* Match Scorer List */
.match-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-item-left {
    display: flex;
    gap: 16px;
    align-items: center;
}

.match-score-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.15);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(13, 148, 136, 0.3);
}

.match-info h4 {
    font-size: 1.05rem;
    font-weight: 600;
}

.match-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.match-details-popover {
    font-size: 0.75rem;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    margin-top: 4px;
    color: var(--text-muted);
}

/* Login Page Styles */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #0f172a 0%, #020617 100%);
    padding: 20px;
}

.login-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
