/**
 * e-WeddingPlanning — Custom Styles
 * Complements TailwindCSS with wedding-specific styling
 */

/* ─── Base ──────────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ────────────────────────────────────────────────────── */
.font-display,
h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 999px;
}

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

/* ─── Cards ─────────────────────────────────────────────────────────── */
.wedding-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.wedding-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
}

.wedding-card-highlight {
    background: linear-gradient(135deg, #FFF5F5 0%, #FFFFFF 50%, #F0F5EF 100%);
}

/* ─── Countdown ─────────────────────────────────────────────────────── */
.countdown-container {
    background: linear-gradient(135deg, #F4E1E1 0%, #FEFCFB 30%, #F0F5EF 70%, #F8F5F2 100%);
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.countdown-number {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: #2D2D2D;
}

.countdown-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    margin-top: 0.25rem;
}

/* ─── Status Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.badge-confirmed {
    background: #DCFCE7;
    color: #166534;
}

.badge-pending {
    background: #FEF9C3;
    color: #854D0E;
}

.badge-declined {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-maybe {
    background: #E0E7FF;
    color: #3730A3;
}

.badge-prospect {
    background: #F3F4F6;
    color: #4B5563;
}

.badge-contacted {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-quoted {
    background: #FEF3C7;
    color: #92400E;
}

.badge-booked {
    background: #D1FAE5;
    color: #065F46;
}

.badge-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

/* Priority badges */
.badge-urgent {
    background: #FEE2E2;
    color: #DC2626;
}

.badge-high {
    background: #FED7AA;
    color: #C2410C;
}

.badge-medium {
    background: #BFDBFE;
    color: #1D4ED8;
}

.badge-low {
    background: #E5E7EB;
    color: #6B7280;
}

/* ─── Guest Avatar ──────────────────────────────────────────────────── */
.guest-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.guest-avatar-sm {
    width: 32px;
    height: 32px;
}

.guest-avatar-lg {
    width: 80px;
    height: 80px;
}

/* Category color rings */
.category-ring-family_partner1 { border-color: #E8C4C4; }
.category-ring-family_partner2 { border-color: #93C5FD; }
.category-ring-friends_partner1 { border-color: #A8C5A0; }
.category-ring-friends_partner2 { border-color: #C4B5FD; }
.category-ring-colleagues { border-color: #FCD34D; }
.category-ring-children { border-color: #FDBA74; }
.category-ring-other { border-color: #D1D5DB; }

/* ─── Progress Bars ─────────────────────────────────────────────────── */
.progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #F3F4F6;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

.progress-bar-fill-green { background: linear-gradient(90deg, #A8C5A0, #7BA37A); }
.progress-bar-fill-gold { background: linear-gradient(90deg, #D4C07A, #C5A55A); }
.progress-bar-fill-pink { background: linear-gradient(90deg, #F4E1E1, #E8C4C4); }
.progress-bar-fill-red { background: linear-gradient(90deg, #FCA5A5, #EF4444); }

/* ─── Stat Cards ────────────────────────────────────────────────────── */
.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ─── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 1.25rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* ─── Form Elements ─────────────────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #FAFAFA;
}

.form-input:focus {
    outline: none;
    border-color: #A8C5A0;
    box-shadow: 0 0 0 3px rgba(168, 197, 160, 0.2);
    background: white;
}

.form-label {
    display: block;
    font-size: 0.813rem;
    font-weight: 500;
    color: #4B5563;
    margin-bottom: 0.375rem;
}

.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    background: #FAFAFA;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    transition: all 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #A8C5A0;
    box-shadow: 0 0 0 3px rgba(168, 197, 160, 0.2);
    background-color: white;
}

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #A8C5A0, #7BA37A);
    color: white;
    box-shadow: 0 2px 8px rgba(123, 163, 122, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7BA37A, #5E8A5C);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 163, 122, 0.4);
}

.btn-secondary {
    background: #F3F4F6;
    color: #4B5563;
}

.btn-secondary:hover {
    background: #E5E7EB;
}

.btn-gold {
    background: linear-gradient(135deg, #D4C07A, #C5A55A);
    color: white;
    box-shadow: 0 2px 8px rgba(197, 165, 90, 0.3);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #C5A55A, #B8952E);
    transform: translateY(-1px);
}

.btn-danger {
    background: #FEE2E2;
    color: #DC2626;
}

.btn-danger:hover {
    background: #FECACA;
}

.btn-outline {
    background: transparent;
    border: 1px solid #E5E7EB;
    color: #6B7280;
}

.btn-outline:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

/* ─── Animations ────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slideInRight {
    animation: slideInRight 0.3s ease forwards;
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
}

.animate-pulse-gold {
    animation: pulse-gold 2s infinite;
}

/* ─── Seating Chart Canvas ──────────────────────────────────────────── */
.canvas-container {
    border: 1px solid #E5E7EB;
    border-radius: 1rem;
    overflow: hidden;
    background: #FAFAFA;
}

/* ─── Kanban Board ──────────────────────────────────────────────────── */
.kanban-column {
    min-height: 200px;
    border-radius: 1rem;
    padding: 1rem;
}

.kanban-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: grab;
    transition: all 0.15s ease;
}

.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.kanban-card:active {
    cursor: grabbing;
}

/* ─── Tables (data tables) ──────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    text-align: left;
}

.data-table thead th:first-child {
    border-radius: 0.75rem 0 0 0;
}

.data-table thead th:last-child {
    border-radius: 0 0.75rem 0 0;
}

.data-table tbody td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #F3F4F6;
}

.data-table tbody tr:hover {
    background: #FAFAFA;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Tooltips ──────────────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.75rem;
    background: #2D2D2D;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 99;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* ─── Empty States ──────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #F4E1E1, #F0F5EF);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* ─── Print Styles ──────────────────────────────────────────────────── */
@media print {
    aside, header, .no-print {
        display: none !important;
    }
    main {
        margin-left: 0 !important;
    }
    body {
        background: white;
    }
    .wedding-card {
        box-shadow: none;
        border: 1px solid #E5E7EB;
    }
}

/* ─── Responsive ────────────────────────────────────────────────────── */

/* Touch-friendly targets */
@media (pointer: coarse) {
    .btn, .btn-sm {
        min-height: 44px;
        min-width: 44px;
    }
    .form-input, .form-select {
        min-height: 44px;
        font-size: 1rem; /* prevents iOS zoom on focus */
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .countdown-number {
        font-size: 2rem;
    }
    .wedding-card {
        padding: 1.25rem;
    }
    .stat-card {
        padding: 1rem 1.25rem;
    }
    .data-table thead th,
    .data-table tbody td {
        padding: 0.625rem 0.75rem;
    }

    /* Seating chart: stack panels below canvas on tablet */
    .seating-layout {
        flex-direction: column;
        height: auto;
    }
    .seating-sidebar-left {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #F3F4F6;
    }
    .seating-sidebar-right {
        width: 100%;
        max-height: 250px;
        border-left: none;
        border-top: 1px solid #F3F4F6;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .countdown-number {
        font-size: 1.5rem;
    }
    .countdown-label {
        font-size: 0.625rem;
    }
    .wedding-card {
        padding: 1rem;
        border-radius: 0.75rem;
    }
    .stat-card {
        padding: 0.875rem 1rem;
        border-radius: 0.75rem;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    .empty-state {
        padding: 2rem 1rem;
    }
    .empty-state-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .modal-content {
        border-radius: 1rem;
        margin: 0.5rem;
    }
    .kanban-card {
        padding: 0.75rem;
    }
    .guest-avatar {
        width: 40px;
        height: 40px;
    }
    .guest-avatar-lg {
        width: 60px;
        height: 60px;
    }

    /* Data tables: horizontal scroll */
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 600px;
    }
    .data-table thead th,
    .data-table tbody td {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    .btn-sm {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
    .badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.6875rem;
    }
}

/* PWA standalone mode */
@media (display-mode: standalone) {
    body {
        /* Account for iOS safe areas */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}
