/**
 * Custom styles for the appointment system
 * Enhanced for modern admin dashboard
 */

/* General styles */
:root {
    --primary-color: #8e44ad;
    --secondary-color: #e74c3c;
    --success-color: #2ecc71;
    --info-color: #3498db;
    --warning-color: #f39c12;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #34495e;
    --sidebar-width: 250px;
    --topbar-height: 70px;
}

body {
    background-color: #f8f9fc;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 10%, #6c3483 100%);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transition: all 0.3s;
    overflow-y: auto;
}

/* Mobile sidebar handling */
@media (max-width: 767.98px) {
    .sidebar {
        left: -250px; /* Hide the sidebar by default on mobile */
    }
    
    .sidebar.toggled {
        left: 0; /* Show sidebar when toggled */
    }
    
    body.sidebar-toggled .content-wrapper {
        margin-left: 0;
    }
    
    /* Mobile sidebar toggle button */
    #sidebarMobileToggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1050;
        font-size: 1.5rem;
        width: 45px;
        height: 45px;
        line-height: 2;
        text-align: center;
        background-color: var(--primary-color);
        color: white;
        border-radius: 50%;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
}

.sidebar-brand {
    height: var(--topbar-height);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 1.5rem 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    z-index: 1;
}

.sidebar hr {
    margin: 0 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-heading {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
}

.nav-item .nav-link {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

/* Top bar nav items override */
.topbar .nav-item.dropdown {
    display: inline-block;
    width: auto;
}

.topbar .nav-item .nav-link {
    width: auto;
    display: inline-flex;
    align-items: center;
}

.nav-item .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item .nav-link.active {
    color: #fff;
    font-weight: 700;
}

.nav-item .nav-link i {
    margin-right: 0.5rem;
    opacity: 0.8;
}

.nav-item .nav-link.active i {
    opacity: 1;
}

.sidebar-toggled .sidebar {
    width: 0;
    overflow: hidden;
}

.content-wrapper {
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    padding-top: 2.5rem;
    transition: margin-left 0.3s;
}

.sidebar-toggled .content-wrapper {
    margin-left: 0;
}

.sidebar-toggle {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 1100;
    padding: 0.5rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    cursor: pointer;
    display: none;
    width: 40px;
    height: 40px;
    text-align: center;
}

#sidebarToggleTop {
    margin-right: 0.5rem;
    display: inline-block !important;
    cursor: pointer;
}

/* Topbar Styles */
.topbar {
    height: var(--topbar-height);
    background-color: #fff;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    z-index: 900;
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    transition: left 0.3s;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.sidebar-toggled .topbar {
    left: 0;
}

.topbar-divider {
    width: 0;
    border-right: 1px solid #e3e6f0;
    height: 2rem;
    margin: auto 1rem;
}

/* Custom Quick Action Buttons */
.quick-actions {
    margin-left: 1rem;
}

.btn-custom-primary {
    background: linear-gradient(to right, var(--primary-color), #6c3483);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(142, 68, 173, 0.2);
    transition: all 0.3s ease;
}

.btn-custom-primary:hover {
    background: linear-gradient(to right, #6c3483, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(142, 68, 173, 0.3);
    color: white;
}

.btn-custom-secondary {
    background: linear-gradient(to right, var(--secondary-color), #bd5d38);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(231, 76, 60, 0.2);
    transition: all 0.3s ease;
}

.btn-custom-secondary:hover {
    background: linear-gradient(to right, #bd5d38, var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(231, 76, 60, 0.3);
    color: white;
}

/* Dashboard Stats Cards */

/* Dashboard cards */
.card {
    margin-bottom: 1.5rem;
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.25);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e3e6f0;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

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

/* Stats cards */
.stats-card {
    border-left: 0.25rem solid;
    border-radius: 0.35rem;
}

.stats-card.primary {
    border-left-color: var(--primary-color);
}

.stats-card.success {
    border-left-color: var(--success-color);
}

.stats-card.info {
    border-left-color: var(--info-color);
}

.stats-card.warning {
    border-left-color: var(--warning-color);
}

.stats-card.danger {
    border-left-color: var(--danger-color);
}

.stats-card .card-body {
    padding: 1.25rem;
}

.stats-card .stats-icon {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 2rem;
    opacity: 0.1;
}

.stats-card .stats-title {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.stats-card .stats-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.stats-card .stats-subtitle {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* Action buttons in cards */
.card-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    color: white;
    font-size: 0.875rem;
    margin: 0 0.25rem;
    transition: all 0.2s;
}

.card-action-btn.primary {
    background-color: var(--primary-color);
}

.card-action-btn.success {
    background-color: var(--success-color);
}

.card-action-btn.danger {
    background-color: var(--danger-color);
}

.card-action-btn.info {
    background-color: var(--info-color);
}

.card-action-btn.warning {
    background-color: var(--warning-color);
}

.card-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

/* Status badges */
.badge {
    padding: 0.4em 0.6em;
}

/* Add subtle hover effect to tables */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Calendar styling */
#calendar {
    max-width: 100%;
    margin: 0 auto;
    height: 650px;
}

.fc-event {
    cursor: pointer;
}

.fc-event:hover {
    filter: brightness(90%);
}

.fc-day-today {
    background-color: rgba(0, 123, 255, 0.05) !important;
}

/* Style for past dates in calendar */
.fc-day-past {
    background-color: #f8f9fa;
}

/* Custom status colors for appointments */
.status-pending {
    background-color: #FFA500;
    color: white;
}

.status-confirmed {
    background-color: #28a745;
    color: white;
}

.status-cancelled {
    background-color: #dc3545;
    color: white;
}

.status-completed {
    background-color: #17a2b8;
    color: white;
}

/* Form styling */
label.form-label {
    font-weight: 500;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button customization */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

/* Animation for dashboard stats */
.display-4 {
    transition: all 0.5s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .navbar, .card-header, .card-footer, button, .btn {
        display: none !important;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .card {
        border: none;
        box-shadow: none;
    }
    
    .card-body {
        padding: 0;
    }
    
    .table th, .table td {
        padding: 0.3rem;
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        width: 0;
        overflow: hidden;
        position: fixed;
        z-index: 1000;
        transition: width 0.3s;
    }
    
    .sidebar.toggled {
        width: var(--sidebar-width);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .topbar {
        left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    body.sidebar-toggled .sidebar {
        width: var(--sidebar-width);
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        margin-bottom: 1rem;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
    
    #calendar {
        height: 500px;
    }
    
    .content-wrapper {
        padding: 1rem;
        padding-top: 3rem;
    }
    
    .stats-card {
        margin-bottom: 1.5rem;
    }
    
    .main-content {
        padding-top: var(--topbar-height);
    }
    
    .card:hover {
        transform: none;
    }
}

/* Icons with spacing */
.btn i, .nav-link i {
    margin-right: 0.25rem;
}

/* Tooltip customization */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    max-width: 300px;
    padding: 0.5rem;
}

/* Search box styling */
#search, #filterForm input, #filterForm select {
    border-radius: 0.25rem;
}

/* Page title styling */
h1.h2 {
    color: #343a40;
    margin-bottom: 0.5rem;
}

p.text-muted {
    margin-bottom: 1.5rem;
}

/* Footer styling */
footer {
    margin-top: 3rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: #6c757d;
}
