/* ===========================================
   Zen Bali - Main Styles
   Orange Monochrome Theme
   Developed by net1io.com
   Copyright (C) 2024
   =========================================== */

:root {
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-300: #fdba74;
    --orange-400: #fb923c;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --orange-800: #9a3412;
    --orange-900: #7c2d12;

    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;

    --primary: var(--orange-500);
    --primary-hover: var(--orange-600);
    --primary-light: var(--orange-100);
    --primary-dark: var(--orange-700);

    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #eab308;
    --warning-light: #fef9c3;
    --error: #ef4444;
    --error-light: #fee2e2;

    --bg-primary: #ffffff;
    --bg-secondary: var(--gray-50);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    --text-inverse: #ffffff;
    --border-light: var(--gray-200);
    --border-default: var(--gray-300);

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    --transition: 200ms ease;
    --container-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

a { color: var(--primary); text-decoration: none; overflow-wrap: anywhere; }
a:hover { color: var(--primary-hover); }

.container { max-width: var(--container-max); width: 100%; margin: 0 auto; padding: 0 1rem; }
img, video, canvas, svg, iframe { max-width: 100%; height: auto; }

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-content { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.nav { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.nav-link { color: var(--text-secondary); font-weight: 500; padding: 0.5rem 1rem; border-radius: var(--radius); transition: all var(--transition); white-space: normal; text-align: center; }
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-light); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--text-inverse); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--gray-100); color: var(--text-primary); border: 1px solid var(--border-default); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary); color: var(--text-inverse); }
.btn-danger { background: var(--error); color: var(--text-inverse); }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.813rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; }
.form-label .required { color: var(--error); }
.form-control {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1); }
textarea.form-control { min-height: 100px; resize: vertical; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 4.5rem; }
.password-field-inline {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    background: var(--bg-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.password-field-inline:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}
.password-field-inline .form-control {
    flex: 1;
    min-width: 0;
    border: none;
    box-shadow: none;
    padding-right: 1rem;
}
.password-field-inline .form-control:focus {
    box-shadow: none;
}
.password-field-inline .password-toggle {
    position: static;
    transform: none;
    margin-right: 0.75rem;
    flex-shrink: 0;
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
}
.password-toggle:hover { color: var(--primary); }
.password-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 0.25rem;
}
select.form-control {
    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;
    padding-right: 2.5rem;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: var(--error); margin-top: 0.25rem; }

/* Cards */
.card { background: var(--bg-primary); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 1.5rem; border-bottom: 1px solid var(--border-light); }
.card-title { font-size: 1.125rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.5rem; }
.card-footer { padding: 1.5rem; border-top: 1px solid var(--border-light); background: var(--bg-secondary); }

/* Event Card */
.event-card { background: var(--bg-primary); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.event-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.event-card-image { position: relative; height: 200px; background: var(--gray-200); }
.event-card-image img { width: 100%; height: 100%; object-fit: cover; }
.event-card-badge { position: absolute; top: 1rem; left: 1rem; padding: 0.25rem 0.5rem; background: var(--primary); color: white; font-size: 0.75rem; font-weight: 500; border-radius: var(--radius); }
.event-card-content { padding: 1.25rem 1.5rem; }
.event-card-date { display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary); font-size: 0.95rem; font-weight: 500; margin-bottom: 0.3rem; line-height: 1.25; }
.event-card-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; line-height: 1.25; }
.event-card-title a { color: inherit; }
.event-card-title a:hover { color: var(--primary); }
.event-card-location { display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary); font-size: 0.95rem; margin-bottom: 0.3rem; line-height: 1.25; }
.event-card-organizer { display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary); font-size: 0.95rem; margin: 0; line-height: 1.25; }
.event-card-footer { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-top: 1px solid var(--border-light); background: var(--bg-secondary); }
.event-card-price { font-weight: 600; color: var(--primary); }
.event-card-type { font-size: 0.75rem; color: var(--text-muted); padding: 0.25rem 0.5rem; background: var(--gray-100); border-radius: var(--radius-full); }

.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }

/* Filters */
.filters { background: var(--bg-primary); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.filter-group { flex: 1; min-width: 150px; }
.filter-group label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.25rem; }
.filter-group select, .filter-group input { width: 100%; padding: 0.5rem; font-size: 0.875rem; border: 1px solid var(--border-default); border-radius: var(--radius); }

/* Badges */
.badge { display: inline-flex; padding: 0.25rem 0.5rem; font-size: 0.75rem; font-weight: 500; border-radius: var(--radius-full); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: #166534; }
.badge-warning { background: var(--warning-light); color: #854d0e; }
.badge-error { background: var(--error-light); color: #991b1b; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* Tables */
.table-container { overflow-x: hidden; width: 100%; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-light); }
.table th { font-weight: 600; color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase; background: var(--bg-secondary); }
.table tbody tr:hover { background: var(--bg-secondary); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 2rem; }
.pagination-btn { padding: 0.5rem 1rem; font-size: 0.875rem; color: var(--text-secondary); background: var(--bg-primary); border: 1px solid var(--border-default); border-radius: var(--radius); cursor: pointer; }
.pagination-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Alerts */
.alert { padding: 1rem 1.5rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: var(--error-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #854d0e; border: 1px solid #fef08a; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all var(--transition); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--bg-primary); border-radius: var(--radius-lg); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; transform: scale(0.9); transition: transform var(--transition); }
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem; border-bottom: 1px solid var(--border-light); }
.modal-title { font-size: 1.25rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; gap: 1rem; justify-content: flex-end; padding: 1.5rem; border-top: 1px solid var(--border-light); }

/* Footer */
.footer { background: var(--gray-900); color: var(--gray-300); padding: 2rem 0; margin-top: auto; }
.footer-content { text-align: center; }
.footer-stats { margin-bottom: 1rem; font-size: 0.875rem; }
.footer-stats span { color: var(--orange-400); }
.footer-credit { font-size: 0.813rem; color: var(--gray-400); }
.footer-credit a { color: var(--orange-400); }

/* Loading */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; padding: 3rem; }
.loading-lg .spinner { width: 40px; height: 40px; border-width: 3px; }

/* Empty State */
.empty-state { text-align: center; padding: 3rem; }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-state-text { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.d-flex { display: flex; }
.d-none { display: none; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .container {
        padding: 0 0.875rem;
    }

    .card-header,
    .card-body,
    .card-footer,
    .filters,
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .btn,
    .btn-sm,
    .btn-lg {
        max-width: 100%;
        white-space: normal;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        position: static;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .logo {
        justify-content: center;
        text-align: center;
        font-size: 1.25rem;
    }

    .nav {
        width: 100%;
        justify-content: center;
        margin-top: 0;
        gap: 0.5rem;
    }

    .nav-link {
        flex: 1 1 40%;
        min-width: 0;
        padding: 0.5rem 0.625rem;
        font-size: 0.875rem;
    }

    .filter-row { flex-direction: column; }
    .filter-group { width: 100%; }
    .event-grid { grid-template-columns: 1fr; }

    [style*="grid-template-columns"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    [style*="display: flex"] {
        flex-wrap: wrap;
    }

    .table,
    .table thead,
    .table tbody,
    .table tr,
    .table th,
    .table td {
        display: block;
        width: 100%;
    }

    .table thead {
        display: none;
    }

    .table tr {
        padding: 0.875rem 0;
        border-bottom: 1px solid var(--border-light);
    }

    .table td {
        padding: 0.35rem 0;
        border-bottom: none;
        white-space: normal;
        word-break: break-word;
    }

    .table tbody tr:hover {
        background: transparent;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .modal {
        width: calc(100% - 1rem);
        margin: 0.5rem;
    }
}
