/*
 * SalonPro X - UI Components Styles
 * Glassmorphism, Cards, Sidebar, Navbar, Stats Cards
 */

/* ===== Glassmorphism ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.glass-sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
}

.glass-nav {
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-dropdown {
    background: rgba(26, 26, 26, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.glass-alert {
    background: rgba(26, 26, 26, 0.9) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base), transform var(--transition-base);
    overflow: hidden;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo img {
    height: 36px;
    width: auto;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    margin: 2px 8px;
}

.sidebar-item .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-item .sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--gold-primary);
}

.sidebar-item .sidebar-link i:first-child {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-item.active .sidebar-link {
    background: rgba(200, 164, 78, 0.1);
    color: var(--gold-primary);
    border: 1px solid var(--border-gold);
}

.submenu-arrow {
    margin-left: auto;
    transition: transform var(--transition-base);
    font-size: 12px;
}

.sidebar-item.has-submenu.show .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
}

.sidebar-item.show .submenu,
.submenu.show {
    display: block;
}

.submenu .sidebar-link {
    padding-left: 48px;
    font-size: 13px;
}

.sidebar-section {
    padding: 16px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.sidebar-version {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Main Wrapper ===== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-base);
}

/* ===== Top Navbar ===== */
.top-navbar {
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--navbar-height);
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height);
    padding: 0 24px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.search-box {
    position: relative;
    max-width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-input {
    width: 240px;
    max-width: calc(100vw - 300px);
    padding-left: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    height: 36px;
    font-size: 13px;
    transition: width var(--transition-base), border-color var(--transition-base);
}
.search-input:focus {
    width: 300px;
    border-color: var(--gold-primary);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #DC3545;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notification-dropdown {
    width: 360px;
    max-height: 400px;
}

/* User Dropdown */
.user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    height: auto;
    padding: 4px 8px;
    border-radius: var(--radius-md);
}
.user-dropdown:hover {
    background: var(--bg-hover);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--border-gold);
    flex-shrink: 0;
}
.user-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-primary);
    color: #000;
    font-size: 13px;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}
.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Page Content ===== */
.page-content {
    flex: 1;
}
.page-content > .container-fluid {
    padding-left: 24px;
    padding-right: 24px;
}

.page-breadcrumb {
    padding: 12px 36px;
    border-bottom: 1px solid var(--border-light);
}
.page-breadcrumb .breadcrumb {
    margin: 0;
}
.page-breadcrumb .breadcrumb-item {
    font-size: 13px;
}
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ===== Stats Cards ===== */
.stats-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}
.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.stats-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid;
    flex-shrink: 0;
}

.stats-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stats-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stats-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stats-trend {
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}

.stats-card-link {
    text-decoration: none;
    display: block;
}

/* ===== Card Component ===== */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}
.card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-icon {
    color: var(--gold-primary);
    font-size: 16px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}
.card-body {
    padding: 20px;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
}
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    background: transparent;
}

/* ===== Table Container ===== */
.table-container {
    overflow-x: auto;
}
.table-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
}

/* ===== Alert Container ===== */
.alert-container {
    padding: 12px 24px 0;
}
.alert-container .alert {
    margin-bottom: 8px;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 13, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spinner {
    text-align: center;
}
.spinner-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
.spinner-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Auth Page ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

.auth-container {
    width: 440px;
    max-width: 90%;
    position: relative;
    z-index: 2;
}

.auth-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    margin-bottom: 16px;
}
.auth-logo img {
    height: 48px;
}

.auth-header h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 4px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
}
.auth-footer p {
    color: var(--text-muted);
    font-size: 12px;
}

.auth-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}
.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.03;
}
.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--gold-primary);
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}
.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--gold-light);
    bottom: -50px;
    left: -50px;
    animation: float 10s ease-in-out infinite reverse;
}
.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--gold-dark);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 12s ease-in-out infinite;
}

/* ===== POS Specific ===== */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - var(--navbar-height) - 80px);
}

.pos-items {
    overflow-y: auto;
}

.pos-cart {
    position: sticky;
    top: 0;
}

.pos-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.pos-total-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.pos-total-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-primary);
}

/* ===== FullCalendar Dark Theme Overrides ===== */
#calendar {
    --fc-page-bg-color: var(--bg-surface);
    --fc-page-text-color: var(--text-primary);
    --fc-border-color: var(--border-color);
    --fc-neutral-bg-color: var(--bg-secondary);
    --fc-today-bg-color: rgba(200, 164, 78, 0.12);
    --fc-event-bg-color: var(--gold-primary);
    --fc-event-border-color: var(--gold-dark);
    --fc-event-text-color: #000;
    --fc-list-event-hover-bg-color: var(--bg-hover);
    --fc-more-link-bg-color: var(--bg-hover);
    --fc-more-link-text-color: var(--text-primary);
    --fc-button-text-color: var(--text-secondary);
    --fc-button-bg-color: var(--bg-surface);
    --fc-button-border-color: var(--border-color);
    --fc-button-hover-bg-color: var(--bg-hover);
    --fc-button-hover-border-color: var(--gold-primary);
    --fc-button-hover-text-color: var(--gold-primary);
    --fc-button-active-bg-color: var(--gold-primary);
    --fc-button-active-border-color: var(--gold-primary);
    --fc-button-active-text-color: #000;
    --fc-non-business-color: rgba(255, 255, 255, 0.02);
    --fc-highlight-color: rgba(200, 164, 78, 0.08);
}
#calendar a {
    color: var(--text-primary);
}
#calendar a:hover {
    color: var(--gold-primary);
}
.fc .fc-toolbar-title {
    color: var(--text-primary);
    font-size: 1.2em;
}
.fc .fc-col-header-cell-cushion {
    color: var(--text-secondary);
    font-weight: 600;
}
.fc .fc-daygrid-day-number {
    color: var(--text-secondary);
}
.fc .fc-daygrid-more-link {
    color: var(--gold-primary);
}
.fc .fc-timegrid-slot-label-cushion {
    color: var(--text-muted);
}
.fc .fc-popover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}
.fc .fc-popover-title {
    color: var(--text-primary);
}
.fc .fc-popover-header {
    background: var(--bg-surface);
}
.fc .fc-list-day-cushion {
    background: var(--bg-surface);
}
.fc .fc-list-day-text {
    color: var(--text-primary);
}
.fc .fc-list-day-side-text {
    color: var(--text-muted);
}
.fc .fc-list-table td {
    border-color: var(--border-light);
}
.fc .fc-scrollgrid {
    border-color: var(--border-color);
}
.fc .fc-scrollgrid-section > td {
    border-color: var(--border-color);
}
.fc th {
    border-color: var(--border-color);
}
.fc td {
    border-color: var(--border-light);
}
.fc .fc-timegrid-now-indicator-line {
    border-color: var(--gold-primary);
}
.fc .fc-timegrid-now-indicator-arrow {
    border-color: var(--gold-primary);
    fill: var(--gold-primary);
}

/* Adjust calendar height for glass card */
.fc {
    min-height: 550px;
}
.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1em;
    padding: 12px 16px 0;
}

/* ===== Calendar Container ===== */
.calendar-container {
    min-height: 600px;
}
/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px;
}

/* ===== Footer ===== */
.app-footer {
    position: relative;
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    padding: 8px 24px;
    flex-shrink: 0;
}
.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-content p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Page Title ===== */
.page-title h5 {
    font-size: 18px;
    font-weight: 600;
}

/* ===== Notification Items ===== */
.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}
.notification-item:hover {
    background: var(--bg-hover);
}
.notification-item.unread {
    background: rgba(200, 164, 78, 0.05);
    border-left: 3px solid var(--gold-primary);
}

/* ===== Nav Tabs Gold ===== */
.nav-tabs-gold {
    border-bottom: 1px solid var(--border-color);
}
.nav-tabs-gold .nav-link {
    color: var(--text-muted);
    border: none;
    padding: 10px 20px;
    font-weight: 500;
    transition: color var(--transition-fast);
}
.nav-tabs-gold .nav-link:hover {
    color: var(--text-primary);
    border: none;
}
.nav-tabs-gold .nav-link.active {
    color: var(--gold-primary);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--gold-primary);
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-paid { background: rgba(40, 167, 69, 0.15); color: #28A745; }
.status-unpaid { background: rgba(220, 53, 69, 0.15); color: #DC3545; }
.status-partial { background: rgba(255, 193, 7, 0.15); color: #FFC107; }
.status-pending { background: rgba(255, 193, 7, 0.15); color: #FFC107; }
.status-cancelled { background: rgba(108, 117, 125, 0.15); color: #6C757D; }
.status-completed { background: rgba(40, 167, 69, 0.15); color: #28A745; }
.status-active { background: rgba(40, 167, 69, 0.15); color: #28A745; }
.status-inactive { background: rgba(108, 117, 125, 0.15); color: #6C757D; }

/* ===== Search Results Dropdown ===== */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}
.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}
.search-result-item:hover {
    background: var(--bg-hover);
}
.search-result-item:last-child {
    border-bottom: none;
}
