/* =====================================================
   Invitar.app - Bulma 1.0 Theme Configuration
   ===================================================== */

@charset "utf-8";

:root {
    /* Brand Colors (Purple Accent) #8b5cf6 -> HSL(258, 90%, 66%) */
    --bulma-primary-h: 258deg;
    --bulma-primary-s: 90%;
    --bulma-primary-l: 66%;
    --bulma-primary: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l));

    /* Font Family */
    --bulma-family-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Global Radius */
    --bulma-radius: 8px;
    --bulma-radius-large: 16px;

    /* Dark Theme Overrides to match original specific dark colors */
    /* Original BG: #0a0a0b -> HSL(240, 5%, 4%) */
    /* Original Secondary: #111113 -> HSL(240, 6%, 7%) */
    /* Original Card: #18181b -> HSL(240, 5%, 10%) */
}

/* Force Dark Mode Colors when data-theme="dark" (or standard Bulma dark mode) */
[data-theme="dark"],
:root {
    --bulma-scheme-main-h: 240deg;
    --bulma-scheme-main-s: 5%;
    --bulma-scheme-main-l: 4%;
    --bulma-scheme-main: hsl(var(--bulma-scheme-main-h), var(--bulma-scheme-main-s), var(--bulma-scheme-main-l));

    --bulma-background-h: 240deg;
    --bulma-background-s: 6%;
    --bulma-background-l: 7%;
    --bulma-background: hsl(var(--bulma-background-h), var(--bulma-background-s), var(--bulma-background-l));

    --bulma-card-background-color: hsl(240, 5%, 10%);
    --bulma-card-radius: 16px;
    --bulma-card-shadow: none;

    --bulma-border-l: 15%;
    /* Darker borders */

    /* Text Colors */
    --bulma-text: #fafafa;
    --bulma-text-weak: #a1a1aa;
    --bulma-text-strong: #ffffff;

    /* Legacy Variable Aliases (for backward compatibility with existing views) */
    --text-primary: #fafafa;
    --text-muted: #a1a1aa;
    --border: var(--bulma-border);
    --border-color: var(--bulma-border);
    --bg-main: #0a0a0b;
    --bg-secondary: #111113;
    --bg-card: #18181b;
    --bg-elevated: #27272a;
    --accent-light: #a78bfa;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* Card border for better visibility */
.card {
    border: 2px solid hsl(240, 5%, 18%);
}

/* Utilities */
.logo-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--bulma-primary);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Helper to replicate dashboard-grid if needed, but perfer usage of columns */
.is-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media screen and (max-width: 768px) {
    .is-dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

/* Status Pills */
.status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pill.is-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-pill.is-draft {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-pill.is-archived {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Custom Scrollbar for dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bulma-scheme-main);
}

::-webkit-scrollbar-thumb {
    background: var(--bulma-background);
    border-radius: 4px;
}


/* =====================================================
   Dashboard Layout (Ported & Refactored)
   ===================================================== */

/* Layout Structure */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.dashboard-sidebar {
    width: 260px;
    background: var(--bulma-background);
    border-right: 1px solid var(--bulma-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--bulma-border);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--bulma-text-weak);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    color: var(--bulma-text);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-item.is-active {
    color: var(--bulma-primary);
    background: rgba(138, 92, 246, 0.1);
    /* fallback opacity */
    background: color-mix(in srgb, var(--bulma-primary) 10%, transparent);
    border-left-color: var(--bulma-primary);
}

.sidebar-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: var(--bulma-border);
    margin: 1rem 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--bulma-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bulma-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

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

.sidebar-user-name {
    color: var(--bulma-text);
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.2;
}

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

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    background: var(--bulma-scheme-main);
}

/* Mobile Header */
.dashboard-header {
    background: var(--bulma-background);
    border-bottom: 1px solid var(--bulma-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Mobile Navigation */
.mobile-nav {
    background: var(--bulma-background);
    border-bottom: 1px solid var(--bulma-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav.is-open {
    max-height: 400px;
}

.mobile-nav-content {
    padding: 0.5rem 0;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--bulma-text-weak);
    transition: all 0.2s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item.is-active {
    color: var(--bulma-primary);
    background: color-mix(in srgb, var(--bulma-primary) 10%, transparent);
}

.mobile-nav-divider {
    height: 1px;
    background: var(--bulma-border);
    margin: 0.5rem 1rem;
}

/* Mobile adjustments */
@media screen and (max-width: 1023px) {

    .dashboard-main {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger>* {
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

.stagger>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger>*:nth-child(4) {
    animation-delay: 0.4s;
}

/* =====================================================
   Custom Modal Styles (Dark Theme)
   ===================================================== */

/* Modal overlay */
.modal.is-active .modal-background {
    animation: fadeIn 0.2s ease-out;
}

/* Modal card container */
.modal .modal-card {
    background: var(--bg-card, hsl(240, 5%, 10%));
    border: 1px solid hsl(240, 5%, 18%);
    border-radius: 16px;
    overflow: hidden;
    max-width: 520px;
    width: calc(100% - 2rem);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal.is-closing .modal-card {
    animation: modalOut 0.2s ease-in forwards;
}

.modal.is-closing .modal-background {
    animation: fadeOut 0.2s ease-in forwards;
}

/* Modal header */
.modal .modal-card-head {
    background: var(--bg-secondary, #111113);
    border-bottom: 1px solid hsl(240, 5%, 18%);
    padding: 1.25rem 1.5rem;
}

.modal .modal-card-head .modal-card-title {
    color: var(--text-primary, #fafafa);
    font-weight: 600;
    font-size: 1.1rem;
}

.modal .modal-card-head .delete {
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease;
}

.modal .modal-card-head .delete:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal body */
.modal .modal-card-body {
    background: var(--bg-card, hsl(240, 5%, 10%));
    padding: 1.5rem;
}

.modal .modal-card-body .label {
    color: var(--text-primary, #fafafa);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

.modal .modal-card-body .input,
.modal .modal-card-body .textarea,
.modal .modal-card-body select {
    background: var(--bg-secondary, #111113);
    border: 1px solid hsl(240, 5%, 20%);
    color: var(--text-primary, #fafafa);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal .modal-card-body .input:focus,
.modal .modal-card-body .textarea:focus,
.modal .modal-card-body select:focus {
    border-color: var(--bulma-primary);
    box-shadow: 0 0 0 3px rgba(138, 92, 246, 0.15);
}

.modal .modal-card-body .input::placeholder,
.modal .modal-card-body .textarea::placeholder {
    color: rgba(161, 161, 170, 0.5);
}

.modal .modal-card-body .help {
    color: var(--text-muted, #a1a1aa);
    font-size: 0.78rem;
}

/* Modal footer */
.modal .modal-card-foot {
    background: var(--bg-secondary, #111113);
    border-top: 1px solid hsl(240, 5%, 18%);
    padding: 1rem 1.5rem;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal .modal-card-foot .button:not(.is-primary) {
    background: transparent;
    border: 1px solid hsl(240, 5%, 25%);
    color: var(--text-muted, #a1a1aa);
}

.modal .modal-card-foot .button:not(.is-primary):hover {
    border-color: hsl(240, 5%, 35%);
    color: var(--text-primary, #fafafa);
}

/* Phone code selector */
.phone-field-group {
    display: flex;
    gap: 0.5rem;
}

.phone-field-group .phone-code-select {
    flex: 0 0 130px;
    min-width: 130px;
}

.phone-field-group .phone-code-select select {
    width: 100%;
    height: 100%;
    padding-right: 1.5rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 10px;
    font-size: 0.875rem;
}

.phone-field-group .phone-number-input {
    flex: 1;
}

/* Modal animations */
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Modal mobile adjustments */
@media screen and (max-width: 768px) {
    .modal .modal-card {
        margin: 0 0.75rem;
        max-height: 90vh;
    }

    .phone-field-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .phone-field-group .phone-code-select {
        flex: 0 0 auto;
        min-width: 100%;
    }
}