@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #004d99; /* Azul del logo Vidamed */
    --primary-hover: #003a75;
    --secondary-color: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f1f5f9;
    --white: #ffffff;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-dark);
}

/* Layout */
.wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--white);
    border-right: 1px solid #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--header-height);
    min-height: var(--header-height);
    max-height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #e2e8f0;
    justify-content: space-between;
    box-sizing: border-box;
}

.sidebar.collapsed .sidebar-header .logo-text {
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-menu {
    padding: 20px 0;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-menu-title {
    padding: 10px 25px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.sidebar.collapsed .sidebar-menu-title {
    display: none;
}

.sidebar-item {
    padding: 0 15px;
    margin-bottom: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.sidebar-link i {
    font-size: 1.25rem;
    min-width: 24px;
    margin-right: 10px;
}

.sidebar.collapsed .sidebar-link i {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-link span {
    display: none;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: rgba(0, 77, 153, 0.05);
    color: var(--primary-color);
    font-weight: 500;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header */
.top-header {
    height: var(--header-height);
    min-height: var(--header-height);
    max-height: var(--header-height);
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-sizing: border-box;
}

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

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background-color: var(--bg-light);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(0, 77, 153, 0.1);
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

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

.header-icon {
    position: relative;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

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

.header-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 3px 5px;
    border-radius: 10px;
    border: 2px solid var(--white);
}

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

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

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

/* Page Content */
.page-content {
    padding: 30px;
    flex-grow: 1;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    background-color: var(--white);
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    padding: 24px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-right: 20px;
}

.stat-icon.primary { background-color: rgba(0, 77, 153, 0.1); color: var(--primary-color); }
.stat-icon.success { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.info { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }

.stat-details h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-details p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    margin-top: 5px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-light-primary {
    background-color: rgba(0, 77, 153, 0.1);
    color: var(--primary-color);
    border: none;
}
.btn-light-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Tables */
.table-responsive {
    border-radius: 8px;
}
.table {
    margin-bottom: 0;
}
.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom-width: 1px;
    padding: 15px;
}
.table td {
    padding: 15px;
    vertical-align: middle;
    color: var(--text-dark);
    font-size: 0.9rem;
    border-bottom-color: #f1f5f9;
}
.table tbody tr:hover {
    background-color: #f8fafc;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}
.patient-name-cell {
    display: flex;
    align-items: center;
}
.patient-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}
.patient-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Badges */
.badge-soft-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.badge-soft-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}
.badge-soft-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.badge-soft-primary {
    background-color: rgba(0, 77, 153, 0.1);
    color: var(--primary-color);
}

/* Login Page specific */
.login-page {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    display: flex;
}

.login-left {
    padding: 60px 50px;
    width: 50%;
}

.login-right {
    width: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #002244 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-right::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.login-logo i {
    font-size: 2rem;
}

/* FullCalendar Overrides */
.fc-theme-standard .fc-scrollgrid {
    border: none;
}
.fc-theme-standard td, .fc-theme-standard th {
    border-color: #f1f5f9;
}
.fc-col-header-cell-cushion {
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 0 !important;
}
.fc-daygrid-day-number {
    color: var(--text-dark);
    font-weight: 500;
    padding: 8px !important;
}
.fc .fc-button-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.fc .fc-button-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}
.fc .fc-button-primary:not(:disabled):active, .fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: #003a75;
    border-color: #003a75;
}
.fc-event {
    border: none;
    border-radius: 4px;
    padding: 3px 5px;
    font-size: 0.8rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.fc-event-main {
    color: #fff;
}
.fc-day-today {
    background-color: rgba(0, 77, 153, 0.05) !important;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .login-card {
        flex-direction: column;
        max-width: 400px;
    }
    .login-left {
        width: 100%;
        padding: 40px 30px;
    }
    .login-right {
        display: none;
    }
}
