/* Base / Reset */
:root {
    --bg-color: #f3f4f6;
    --sidebar-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Primary colors */
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;

    /* Semantic colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;

    /* Shadows & Transitions */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography utilities */
.text-blue { color: var(--primary); }
.text-green { color: var(--success); }
.text-purple { color: var(--purple); }
.bg-blue-light { background-color: var(--primary-light); }
.bg-green-light { background-color: var(--success-light); }
.bg-purple-light { background-color: var(--purple-light); }

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Glassmorphism utility */
.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-sm);
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: var(--transition);
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-nav {
    padding: 24px 16px;
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav li:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.sidebar-nav li.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.sidebar-nav li i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.top-header {
    height: 80px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 5;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    padding: 10px 16px;
    border-radius: 20px;
    width: 320px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.search-bar:focus-within {
    border-color: var(--primary-light);
    background-color: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 12px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
}

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

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--primary);
}

.notification-dot {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

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

.user-profile img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

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

/* Views */
.views-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    scroll-behavior: smooth;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active-view {
    display: block;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.view-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.3);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    padding: 24px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-info {
    flex: 1;
}

.metric-info h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.metric-value {
    display: flex;
    align-items: center;
    gap: 12px;
}

.metric-value > span:first-child {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge.positive {
    background-color: var(--success-light);
    color: var(--success);
}

.badge.negative {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Cards & Lists */
.card {
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
}

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

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.link-btn {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.link-btn:hover {
    text-decoration: underline;
}

/* Appointments List Styles */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.appointment-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.appointment-item:hover {
    background-color: white;
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.apt-time {
    width: 80px;
    font-weight: 600;
    color: var(--primary);
}

.apt-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.apt-name {
    font-weight: 600;
    color: var(--text-main);
}

.apt-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.apt-status {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-upcoming {
    background-color: var(--primary-light);
    color: var(--primary);
}

.status-completed {
    background-color: var(--success-light);
    color: var(--success);
}

.status-canceled {
    background-color: var(--danger-light);
    color: var(--danger);
}

.apt-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.icon-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.placeholder-text {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

/* Calendar */
.calendar-wrapper {
    display: flex;
    flex-direction: column;
}

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

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

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

.cal-day-name {
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    padding: 12px 0;
    font-size: 0.9rem;
}

.cal-day {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    cursor: pointer;
    background-color: var(--bg-color);
    transition: var(--transition);
    position: relative;
}

.cal-day:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.cal-day.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.cal-day.has-apt::after {
    content: '';
    position: absolute;
    bottom: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
}

.cal-day.active.has-apt::after {
    background-color: white;
}

.cal-day.disabled {
    color: #cbd5e1;
    cursor: default;
    background-color: transparent;
}

/* Patients Table */
.table-actions {
    display: flex;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-responsive {
    overflow-x: auto;
}

.patients-table {
    width: 100%;
    border-collapse: collapse;
}

.patients-table th,
.patients-table td {
    padding: 16px 24px;
    text-align: left;
}

.patients-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.02);
}

.patients-table td {
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.patients-table tbody tr {
    transition: var(--transition);
}

.patients-table tbody tr:hover {
    background-color: rgba(243, 244, 246, 0.5);
}

/* Forms */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    background-color: var(--bg-color);
}

.form-control:focus {
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}
