/**
 * Max Event Cloud - Theme CSS
 * Pastel/Ice Cream Color Palette
 */

:root {
    --primary-color: #E8D4F8;
    --secondary-color: #D4E8F8;
    --accent-color: #F8E8D4;
    --success-color: #D4F8D8;
    --danger-color: #F8D4D4;
    --warning-color: #F8F0D4;
    --info-color: #D4F0F8;

    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --bg-light: #F9F7FC;
    --border-color: #E0D4E8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   GENERAL STYLES
   ============================================================ */
html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: #f8f9fa;
}

body {
    font-size: 0.95rem;
    line-height: 1.6;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #E8D4F8 0%, #D4E8F8 100%);
    color: var(--text-primary);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #DCC0EC 0%, #C0DDD4 100%);
    color: var(--text-primary);
}

.btn-secondary {
    background-color: #e9ecef;
    color: var(--text-primary);
    border: none;
}

.btn-secondary:hover {
    background-color: #dee2e6;
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #D4F8D8 0%, #C8F0D0 100%);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, #F8D4D4 0%, #F0C8C8 100%);
    color: var(--text-primary);
}

.btn-warning {
    background: linear-gradient(135deg, #F8F0D4 0%, #F0E8C8 100%);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    background: white;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: linear-gradient(135deg, #E8D4F8 0%, #D4E8F8 100%);
    border-color: var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.card-footer {
    background-color: #f9f7fc;
    border-color: var(--border-color);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: white;
}

.form-control:focus, .form-select:focus {
    border-color: #E8D4F8;
    box-shadow: 0 0 0 0.2rem rgba(232, 212, 248, 0.25);
    background-color: white;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-check-input {
    cursor: pointer;
    border: 1px solid #ccc;
}

.form-check-input:checked {
    background-color: #E8D4F8;
    border-color: #E8D4F8;
}

.form-check-input:focus {
    border-color: #E8D4F8;
    box-shadow: 0 0 0 0.2rem rgba(232, 212, 248, 0.25);
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
    border-color: var(--border-color);
    margin-bottom: 0;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

div.dataTables_wrapper div.dataTables_scrollBody {
    -webkit-overflow-scrolling: touch;
}

.table thead th {
    background-color: #f9f7fc;
    border-color: var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem 0.75rem;
}

.table tbody tr:hover {
    background-color: #fafbfc;
}

.table tbody td {
    padding: 0.75rem;
    border-color: var(--border-color);
    vertical-align: middle;
}

/* DataTables specific */
.dataTables_wrapper {
    margin-bottom: 2rem;
}

.dataTables_filter input {
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

.paginate_button {
    padding: 0.375rem 0.75rem;
    margin: 0 2px;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.paginate_button:hover {
    background-color: #f9f7fc;
    border-color: #E8D4F8;
}

.paginate_button.current {
    background: linear-gradient(135deg, #E8D4F8 0%, #D4E8F8 100%);
    border-color: #E8D4F8;
    color: var(--text-primary);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: 0.375rem;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background-color: #fefce8;
    color: #854d0e;
    border-left: 4px solid #eab308;
}

.alert-info {
    background-color: #f0f9ff;
    color: #0c4a6e;
    border-left: 4px solid #0ea5e9;
}

.btn-close {
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: linear-gradient(110deg, #0f172a 0%, #1d4ed8 40%, #0891b2 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.25rem;
    color: #f8fafc !important;
    font-weight: 600;
}

.navbar-brand .text-primary {
    color: #fde047 !important;
}

.navbar-nav .nav-link {
    color: #e2e8f0 !important;
    margin: 0 0.3rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.24);
    color: #ffffff !important;
}

.navbar .dropdown-toggle,
.navbar .dropdown-toggle small {
    color: #f1f5f9 !important;
}

.navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

/* ============================================================
   BADGES & LABELS
   ============================================================ */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.825rem;
}

.badge-primary {
    background: linear-gradient(135deg, #E8D4F8 0%, #D4E8F8 100%);
    color: var(--text-primary);
}

.badge-success {
    background-color: #D4F8D8;
    color: #1b5e20;
}

.badge-danger {
    background-color: #F8D4D4;
    color: #b71c1c;
}

.badge-warning {
    background-color: #F8F0D4;
    color: #f57c00;
}

.badge-info {
    background-color: #D4F0F8;
    color: #01579b;
}

/* ============================================================
   DROPDOWNS
   ============================================================ */
.dropdown-menu {
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border: none;
}

.dropdown-item {
    color: var(--text-primary);
    padding: 0.625rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(232, 212, 248, 0.1);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* ============================================================
   MODALS (for delete confirmations)
   ============================================================ */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.modal-header {
    background: linear-gradient(135deg, #E8D4F8 0%, #D4E8F8 100%);
    border-color: var(--border-color);
}

.modal-header .btn-close {
    filter: invert(0);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted {
    color: var(--text-muted) !important;
}

.border {
    border-color: var(--border-color) !important;
}

.bg-light {
    background-color: var(--bg-light) !important;
}

/* Shadow utilities */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Spacing utilities */
.rounded {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 100% !important;
        min-height: auto !important;
    }

    .container-fluid {
        padding: 1rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: fadeIn 0.2s ease;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
.btn:focus-visible,
.form-control:focus-visible,
a:focus-visible {
    outline: 2px solid #E8D4F8;
    outline-offset: 2px;
}

/* ============================================================
   DASHBOARD VIEWS
   ============================================================ */
.dashboard-hero {
    background: linear-gradient(130deg, #f3e8ff 0%, #e0f2fe 55%, #ecfeff 100%);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.dashboard-shell {
    max-width: 1240px;
    margin: 0 auto;
}

.dashboard-hero .hero-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.dashboard-hero .hero-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
}

.dashboard-stat-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: linear-gradient(150deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    height: 100%;
}

.dashboard-stat-card.stat-clients {
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
}

.dashboard-stat-card.stat-events {
    background: linear-gradient(145deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #a5b4fc;
}

.dashboard-stat-card.stat-active {
    background: linear-gradient(145deg, #ecfeff 0%, #cffafe 100%);
    border-color: #67e8f9;
}

.dashboard-stat-card.stat-guestlists {
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.dashboard-stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.dashboard-stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.2rem;
    color: #1f2937;
}

.dashboard-stat-help {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.87rem;
}

.dashboard-grid-link {
    display: block;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #2563eb;
    border-radius: 0.75rem;
    background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
    padding: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.18s ease;
    height: 100%;
}

.dashboard-grid-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    text-decoration: none;
    border-left-color: #0891b2;
}

.dashboard-grid-link .link-title {
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.dashboard-grid-link .link-title i {
    margin-right: 0.35rem;
}

.dashboard-grid-link .link-copy {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dashboard-panel {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.1rem;
}

.dashboard-panel h3 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-weight: 700;
}

.dashboard-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed #e5e7eb;
    color: var(--text-secondary);
}

.dashboard-checklist li:last-child {
    border-bottom: none;
}

.dashboard-checklist i {
    color: #0ea5e9;
    margin-top: 0.15rem;
}

.event-hub-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.event-hub-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.event-hub-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

/* ========== Page Header ========== */
.page-header {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background: linear-gradient(135deg, #f5f7ff 0%, #ffffff 100%);
    border: 1px solid #dde3f4;
    border-radius: 1rem;
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.page-header-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 3px 10px rgba(79,70,229,.28);
}

.page-header-icon.phi-amber  { background: linear-gradient(135deg, #b45309, #f59e0b); box-shadow: 0 3px 10px rgba(245,158,11,.28); }
.page-header-icon.phi-rose   { background: linear-gradient(135deg, #be123c, #f43f5e); box-shadow: 0 3px 10px rgba(244,63,94,.28); }
.page-header-icon.phi-teal   { background: linear-gradient(135deg, #0f766e, #14b8a6); box-shadow: 0 3px 10px rgba(20,184,166,.28); }
.page-header-icon.phi-green  { background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 3px 10px rgba(34,197,94,.28); }
.page-header-icon.phi-slate  { background: linear-gradient(135deg, #334155, #64748b); box-shadow: 0 3px 10px rgba(100,116,139,.28); }
.page-header-icon.phi-indigo { background: linear-gradient(135deg, #4338ca, #818cf8); box-shadow: 0 3px 10px rgba(99,102,241,.28); }

.page-header-text {
    flex: 1;
    min-width: 0;
}

.page-header-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.page-header-sub {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-header-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .page-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.9rem 1rem;
    }

    .page-header-sub {
        white-space: normal;
    }

    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .dashboard-hero {
        padding: 1rem;
    }

    .dashboard-hero .hero-title {
        font-size: 1.25rem;
    }

    .dashboard-stat-value {
        font-size: 1.4rem;
    }
}
