/* Dashboard Styles - Extension of app.css */

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

.dashboard-container {
    min-height: calc(100vh - 76px);
    background-color: var(--bs-body-bg);
}

.dashboard-sidebar {
    background-color: var(--surface);
    border-right: 1px solid var(--bs-border-color);
    min-height: calc(100vh - 76px);
    padding: 2rem 0;
}

.dashboard-content {
    padding: 2rem;
}

.dashboard-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.dashboard-nav-link:hover {
    background-color: var(--bs-body-bg);
    color: var(--bs-primary);
}

.dashboard-nav-link.active {
    background-color: var(--primary-lighter);
    color: var(--bs-primary);
    border-left-color: var(--bs-primary);
    font-weight: 600;
}

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

/* ============================================
   DASHBOARD CARDS
   ============================================ */

.dashboard-card {
    background-color: var(--surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.dashboard-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.dashboard-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   IMAGE CROPPER
   ============================================ */

.image-cropper-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.cropper-wrapper {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 0.5rem;
    overflow: hidden;
}

.cropper-preview {
    max-width: 100%;
    display: block;
}

.image-upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    background-color: var(--bs-body-bg);
    cursor: pointer;
    transition: var(--transition);
}

.image-upload-area:hover {
    border-color: var(--bs-primary);
    background-color: var(--primary-lighter);
}

.image-upload-area.dragover {
    border-color: var(--bs-primary);
    background-color: var(--primary-lighter);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin: 0 auto 1rem;
}

.image-upload-area:hover .upload-icon {
    color: var(--bs-primary);
}

.image-preview-container {
    position: relative;
    display: inline-block;
}

.image-preview {
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color);
}

.image-preview-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.image-preview-actions .btn {
    padding: 0.375rem 0.75rem;
}

/* ============================================
   BRANDING SECTION
   ============================================ */

.branding-preview {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.branding-logo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    object-fit: cover;
    border: 3px solid var(--bs-border-color);
}

.branding-logo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-picker-input {
    width: 60px;
    height: 40px;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    cursor: pointer;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    border: 1px solid var(--bs-border-color);
}

/* ============================================
   Analytics
   ============================================ */
/* Analytics Page Styles */
.stat-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 2px 6px;
    background: #ffc107;
    color: #000;
    border-radius: 3px;
    font-weight: 600;
}

.export-card {
    text-align: center;
}

.export-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--primary-color, #4A90E2);
}

.export-icon svg {
    width: 100%;
    height: 100%;
}

.simple-chart {
    min-height: 250px;
}

.top-events-list {
    max-height: 400px;
    overflow-y: auto;
}

.top-event-item:last-child {
    border-bottom: none !important;
}

/* ============================================
   EVENT MANAGEMENT
   ============================================ */

.event-list-item {
    background-color: var(--surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.event-list-item:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border-color: var(--bs-primary);
}

.event-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.event-list-item-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.event-list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.event-list-item-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.event-list-item-meta-item svg {
    width: 16px;
    height: 16px;
}

.event-list-item-actions {
    display: flex;
    gap: 0.5rem;
}

.event-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.event-status-badge.published {
    background-color: #D1FAE5;
    color: #065F46;
}

.event-status-badge.draft {
    background-color: #FEF3C7;
    color: #92400E;
}

.event-status-badge.ended {
    background-color: #E5E7EB;
    color: #1F2937;
}

/* ============================================
   EVENT EDITOR
   ============================================ */

.event-editor-container {
    max-width: 900px;
    margin: 0 auto;
}

.event-editor-section {
    background-color: var(--surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.event-editor-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-editor-section-title svg {
    width: 24px;
    height: 24px;
    color: var(--bs-primary);
}

.location-item {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.location-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.location-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.time-slot-item {
    background-color: var(--surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.time-slot-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-item-button {
    border: 2px dashed var(--bs-border-color);
    background-color: transparent;
    color: var(--text-secondary);
    padding: 0.75rem;
    border-radius: 0.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.add-item-button:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    background-color: var(--primary-lighter);
}

.add-item-button svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   FORM ENHANCEMENTS
   ============================================ */

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.form-help-text {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.form-group-inline {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.form-group-inline .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ============================================
   STATS DASHBOARD
   ============================================ */

.stat-card {
    background-color: var(--surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.stat-card-icon.primary {
    background-color: var(--primary-lighter);
    color: var(--bs-primary);
}

.stat-card-icon.success {
    background-color: #D1FAE5;
    color: #065F46;
}

.stat-card-icon.warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.stat-card-icon.info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.stat-card-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-card-change.positive {
    color: #059669;
}

.stat-card-change.negative {
    color: #DC2626;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--text-tertiary);
    margin: 0 auto 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.btn-icon {
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-group-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 990px) {
    .dashboard-sidebar {
        display:none;
    }
}
@media (max-width: 768px) {
    .xdashboard-sidebar {
        position: fixed;
        left: -280px;
        top: 76px;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .xdashboard-sidebar.show {
        left: 0;
    }

    .dashboard-content {
        padding: 1rem;
    }

    .dashboard-card {
        padding: 1rem;
    }

    .event-list-item-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-group-inline {
        flex-direction: column;
    }

    .stat-card {
        margin-bottom: 1rem;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background-color: var(--surface);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    min-width: 200px;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ============================================
   TOGGLE SWITCHES
   ============================================ */

.form-switch-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-switch-custom .form-check-input {
    width: 48px;
    height: 24px;
    cursor: pointer;
}

.form-switch-custom .form-check-label {
    cursor: pointer;
    font-weight: 500;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-truncate-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-outline {
    border: 1px solid currentColor;
    background-color: transparent;
}

.divider {
    height: 1px;
    background-color: var(--bs-border-color);
    margin: 1.5rem 0;
}

.section-spacing {
    margin-bottom: 2rem;
}