/* ===== CSS Reset & Variables ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #16a34a;
    --accent-dark: #15803d;
    --danger: #dc2626;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Header ===== */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* ===== Hero / Search Section ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 2.5rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.search-bar {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
}

.search-bar input:focus,
.search-bar select:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-bar button:hover {
    background: var(--accent-dark);
}

/* ===== Toolbar ===== */
.toolbar {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    box-shadow: var(--shadow);
}

.view-toggle button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s;
}

.view-toggle button.active {
    background: var(--primary);
    color: var(--white);
}

.result-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Main Content ===== */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ===== Card Grid ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-light), #ede9fe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 3rem;
}

.card-body {
    padding: 1rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.status-dot-open {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot-closed {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.1);
    }
}

.card-body h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.card-body .kategori {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-right: 0.35rem;
}

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-right: 0.35rem;
}

.status-badge i {
    font-size: 0.5rem;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.status-open {
    background: #dcfce7;
    color: var(--accent-dark);
}

.status-closed {
    background: #fee2e2;
    color: var(--danger);
}

.card-body .alamat {
    color: var(--text-light);
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.card-body .alamat i {
    margin-top: 0.15rem;
    font-size: 0.75rem;
}

/* ===== Map View ===== */
#map-view {
    display: none;
    height: 500px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

#map-view.active {
    display: block;
}

#grid-view.active {
    display: grid;
}

#grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm);
}

.popup-content h4 {
    margin-bottom: 0.25rem;
    color: var(--text);
}

.popup-content .popup-kategori {
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.popup-content a {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--primary);
    color: var(--white);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== Detail Page ===== */
.detail-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.detail-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.detail-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), #ede9fe);
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-img-placeholder {
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, var(--primary-light), #ede9fe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 5rem;
}

.detail-body {
    padding: 2rem;
}

.detail-body h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.operating-hours {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
}

.operating-hours i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 0.15rem;
}

.operating-hours strong {
    color: var(--text);
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.25rem;
}

.operating-hours span {
    color: var(--text);
    font-size: 0.9rem;
}

.operating-hours small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.detail-body .kategori {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.detail-body .deskripsi {
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.detail-body .alamat-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.detail-body .alamat-detail i {
    color: var(--primary);
    margin-top: 0.15rem;
}

#detail-map {
    height: 300px;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font);
}

.btn-wa {
    background: var(--accent);
    color: var(--white);
}

.btn-wa:hover {
    background: var(--accent-dark);
    color: var(--white);
}

.btn-back {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-back:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #b91c1c;
    color: var(--white);
}

/* ===== Admin ===== */
.admin-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.admin-card h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table tr:hover {
    background: var(--bg);
}

.admin-table .actions {
    display: flex;
    gap: 0.5rem;
}

.admin-table .actions a,
.admin-table .actions button {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.admin-table .actions .edit {
    background: var(--primary-light);
    color: var(--primary);
}

.admin-table .actions .delete {
    background: #fee2e2;
    color: var(--danger);
}

/* ===== Form ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

#pick-map {
    height: 250px;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    overflow: hidden;
}

.map-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.checkbox-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 600;
}

/* ===== Login ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 1.5rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.login-card .btn {
    width: 100%;
    justify-content: center;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fee2e2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #dcfce7;
    color: var(--accent-dark);
    border: 1px solid #bbf7d0;
}

/* ===== Footer ===== */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar input,
    .search-bar select,
    .search-bar button {
        min-width: unset;
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        justify-content: center;
    }

    .card-grid,
    #grid-view {
        grid-template-columns: 1fr;
    }

    .detail-body {
        padding: 1.25rem;
    }

    .detail-body h1 {
        font-size: 1.35rem;
    }

    .detail-img,
    .detail-img-placeholder {
        height: 220px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }

    .header-inner {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem;
    }

    .card-body h3 {
        font-size: 1rem;
    }
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: slideUp 0.3s ease;
}

.modal-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.modal-card h2 {
    color: var(--accent-dark);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.modal-subtitle {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    text-align: left;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.data-table tr {
    border-bottom: 1px solid var(--border);
}

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

.data-table th {
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    width: 35%;
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    word-break: break-word;
}

.modal-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@media (max-width: 480px) {
    .modal-card {
        padding: 1.5rem;
    }

    .modal-icon {
        font-size: 3rem;
    }

    .modal-card h2 {
        font-size: 1.25rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .data-table th {
        width: 40%;
    }
}

