/* =============================================================
   GUÍA GÁLVEZ - Estilos Premium
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #1e40af; --primary-light: #3b82f6; --primary-dark: #1e3a8a;
    --accent: #f59e0b; --danger: #ef4444; --success: #22c55e;
    --bg: #f8fafc; --surface: #ffffff; --text: #0f172a; --text-light: #64748b;
    --border: #e2e8f0; --shadow: 0 4px 6px -1px rgba(0,0,0,0.07);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --radius: 16px; --radius-sm: 10px; --radius-full: 9999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); opacity: 0; transition: opacity .5s; }
.loaded { opacity: 1; }

/* ---- HEADER ---- */
header { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%); padding: 50px 20px 40px; text-align: center; color: #fff; position: relative; overflow: hidden; }
header::before { content:''; position:absolute; top:-50%; left:-50%; width:200%; height:200%; background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%); animation: headerGlow 8s ease-in-out infinite; }
@keyframes headerGlow { 0%,100%{transform:translate(0,0)} 50%{transform:translate(30px,-20px)} }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; position: relative; z-index: 1; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.logo { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; }
.subtitle { opacity: .85; font-weight: 300; font-style: italic; margin-bottom: 20px; }
h1 { font-size: 2.8rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 6px; }

/* Auth Buttons */
.btn-login { background: rgba(255,255,255,.15); color: #fff; padding: 10px 22px; border-radius: var(--radius-full); text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(8px); transition: .3s; display: inline-flex; align-items: center; gap: 8px; }
.btn-login:hover { background: rgba(255,255,255,.25); transform: translateY(-1px); }
.user-menu { position: relative; }
.btn-user { background: rgba(255,255,255,.15); color: #fff; padding: 8px 16px; border-radius: var(--radius-full); border: 1px solid rgba(255,255,255,.25); cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); min-width: 200px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .2s; z-index: 100; }
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; transition: .15s; }
.user-dropdown a:hover { background: #f1f5f9; }
.user-dropdown a i { width: 18px; color: var(--text-light); }

/* Header Buttons */
.header-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 25px; }
.btn-header { padding: 12px 24px; border-radius: var(--radius-full); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 10px; text-transform: uppercase; font-size: 12px; letter-spacing: .5px; border: 2px solid rgba(255,255,255,.2); transition: .3s; }
.btn-emergency { background: var(--danger); color: #fff; animation: pulse 2s infinite; }
.btn-add { background: var(--success); color: #fff; }
.btn-add:hover { background: #16a34a; transform: scale(1.05); }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(239,68,68,.7)} 70%{box-shadow:0 0 0 12px rgba(239,68,68,0)} 100%{box-shadow:0 0 0 0 rgba(239,68,68,0)} }

/* Search */
.search-container { max-width: 700px; margin: 0 auto; background: rgba(255,255,255,.12); backdrop-filter: blur(12px); padding: 12px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.2); display: flex; flex-wrap: wrap; gap: 8px; }
.search-container input, .search-container select { flex: 1; min-width: 180px; padding: 13px 16px; border-radius: var(--radius-sm); border: none; outline: none; font: inherit; font-size: 15px; color: var(--text); background: #fff; }
.results-counter { background: rgba(255,255,255,.15); padding: 8px 18px; border-radius: var(--radius-full); display: inline-block; margin-top: 15px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); }

/* Category Chips */
.chips-container { display: flex; gap: 8px; overflow-x: auto; padding: 20px 0 10px; scrollbar-width: none; }
.chips-container::-webkit-scrollbar { display: none; }
.chip { padding: 8px 18px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-light); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: .2s; }
.chip:hover { border-color: var(--primary-light); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- CARDS ---- */
#directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; padding: 30px 0 50px; }

.glass-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); display: flex; flex-direction: column; transition: .3s ease; box-shadow: var(--shadow); }
.glass-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.featured-card { border: 2px solid var(--accent) !important; }

.card-img-container { position: relative; height: 180px; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.glass-card:hover .card-img { transform: scale(1.05); }
.card-badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.95); color: var(--primary); padding: 5px 12px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 700; text-transform: uppercase; display: flex; align-items: center; gap: 5px; backdrop-filter: blur(4px); }
.card-featured-badge { position: absolute; top: 12px; right: 12px; background: var(--accent); color: #fff; padding: 5px 12px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 700; display: flex; align-items: center; gap: 5px; }

.card-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.card-desc { font-size: 13px; color: var(--text-light); margin-bottom: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-dir { color: var(--text-light); font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-dir i { color: var(--danger); }
.card-actions { margin-top: auto; }
.rating-container { display: flex; gap: 8px; margin-bottom: 12px; }
.rating-btn, .view-btn { flex: 1; padding: 8px; border-radius: var(--radius-sm); font-weight: 700; font-size: 11px; text-decoration: none; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 5px; transition: .2s; }
.rating-btn { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.view-btn { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.btn-ws { background: var(--success); color: #fff; text-align: center; padding: 12px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; transition: .2s; }
.btn-ws:hover { background: #16a34a; transform: translateY(-1px); }
.secondary-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-sec { background: #f8fafc; color: var(--text); text-align: center; padding: 10px; border-radius: var(--radius-sm); text-decoration: none; font-size: 12px; font-weight: 600; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 6px; transition: .2s; }
.btn-sec:hover { background: #e2e8f0; }

/* Skeleton Loading */
.skeleton-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.skeleton-img { height: 180px; background: #e2e8f0; }
.skeleton-body { padding: 20px; }
.skeleton-line { height: 14px; background: #e2e8f0; border-radius: 6px; margin-bottom: 12px; }
.skeleton-title { width: 70%; height: 20px; }
.skeleton-text { width: 90%; }
.skeleton-text.short { width: 50%; }
.skeleton-btn { height: 42px; margin-top: 10px; }
.shimmer { position: relative; overflow: hidden; }
.shimmer::after { content:''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { left: 100%; } }

/* ---- FOOTER ---- */
footer { background: #0f172a; color: #94a3b8; padding: 30px 20px; text-align: center; font-size: 13px; }

/* ---- TOAST ---- */
.toast-notification { position: fixed; bottom: 30px; right: 30px; padding: 14px 22px; border-radius: var(--radius-sm); color: #fff; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px; z-index: 10000; transform: translateY(20px); opacity: 0; transition: .3s; box-shadow: var(--shadow-lg); }
.toast-notification.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

/* ---- AUTH PAGE ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%); padding: 20px; }
.auth-card { background: var(--surface); border-radius: 24px; padding: 40px; max-width: 440px; width: 100%; box-shadow: 0 25px 50px rgba(0,0,0,.3); }
.auth-card h1 { font-size: 1.8rem; text-align: center; margin-bottom: 6px; color: var(--text); }
.auth-card .auth-sub { text-align: center; color: var(--text-light); font-size: 14px; margin-bottom: 30px; }
.auth-card .logo-link { display: block; text-align: center; margin-bottom: 30px; text-decoration: none; }
.auth-card .logo-text { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input { width: 100%; padding: 13px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); font: inherit; font-size: 15px; transition: .2s; outline: none; }
.form-group input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.btn-primary { width: 100%; padding: 14px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; transition: .2s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-light); }
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; display: none; }

/* ---- ADMIN PAGE ---- */
.admin-header { background: linear-gradient(135deg, #0f172a, #1e293b); color: #fff; padding: 24px; }
.admin-header-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; }
.admin-header h1 { font-size: 1.5rem; }
.admin-header a { color: rgba(255,255,255,.7); text-decoration: none; font-size: 14px; }

.admin-tabs { display: flex; background: var(--surface); border-bottom: 2px solid var(--border); padding: 0 20px; overflow-x: auto; }
.admin-tab { padding: 16px 24px; font-weight: 600; font-size: 14px; color: var(--text-light); cursor: pointer; border: none; background: none; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: .2s; white-space: nowrap; font-family: inherit; position: relative; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-tab .tab-badge { background: var(--danger); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: var(--radius-full); margin-left: 8px; font-weight: 700; }

.tab-content { display: none; padding: 30px 20px; max-width: 1200px; margin: 0 auto; }
.tab-content.active { display: block; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.btn-new { background: var(--primary); color: #fff; border: none; padding: 12px 24px; border-radius: var(--radius-sm); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: .2s; }
.btn-new:hover { background: var(--primary-dark); }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th { background: #f8fafc; padding: 14px 16px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-light); letter-spacing: .5px; border-bottom: 2px solid var(--border); }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: #f8fafc; }
.blocked-row { background: #fef2f2 !important; }
.blocked-row:hover { background: #fee2e2 !important; }

.biz-cell { display: flex; align-items: center; gap: 12px; }
.biz-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

.badge { padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.badge-cat { background: #eff6ff; color: #2563eb; }
.badge-star { background: #fffbeb; color: #d97706; }
.badge-admin { background: #f0fdf4; color: #16a34a; }
.badge-user { background: #f8fafc; color: var(--text-light); }
.badge-blocked { background: #fef2f2; color: #dc2626; }
.badge-active { background: #f0fdf4; color: #16a34a; }
.badge-you { background: var(--primary); color: #fff; margin-left: 6px; font-size: 10px; }

.action-cell { white-space: nowrap; }
.btn-action { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 14px; transition: .2s; margin-left: 4px; }
.btn-edit { color: var(--primary); }
.btn-edit:hover { background: #eff6ff; border-color: #bfdbfe; }
.btn-delete { color: var(--danger); }
.btn-delete:hover { background: #fef2f2; border-color: #fecaca; }
.btn-block { color: #f59e0b; }
.btn-block:hover { background: #fffbeb; border-color: #fde68a; }
.btn-unblock { color: var(--success); }
.btn-unblock:hover { background: #f0fdf4; border-color: #bbf7d0; }

/* Pending Cards */
.pending-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; box-shadow: var(--shadow); }
.pending-info h4 { margin-bottom: 6px; }
.pending-info p { font-size: 13px; color: var(--text-light); display: flex; align-items: center; gap: 6px; }
.pending-desc { margin-top: 6px; font-style: italic; }
.pending-actions { display: flex; gap: 8px; }
.btn-approve { background: var(--success); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-sm); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.btn-reject { background: var(--danger); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-sm); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: .3s; padding: 20px; }
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal { background: var(--surface); border-radius: 20px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 30px; transform: translateY(20px); transition: .3s; }
.modal-overlay.show .modal { transform: translateY(0); }
.modal h2 { font-size: 1.3rem; margin-bottom: 20px; }
.modal .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .form-group input, .modal .form-group textarea, .modal .form-group select { width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius-sm); font: inherit; font-size: 14px; outline: none; transition: .2s; }
.modal .form-group input:focus, .modal .form-group textarea:focus { border-color: var(--primary-light); }
.modal .form-group textarea { resize: vertical; min-height: 80px; }
.checkbox-group { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.checkbox-group input[type="checkbox"] { width: 20px; height: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.btn-cancel { padding: 12px 24px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: none; font: inherit; font-weight: 600; cursor: pointer; }
.btn-save { padding: 12px 24px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); font: inherit; font-weight: 700; cursor: pointer; }

.loading-cell, .empty-cell, .error-cell { text-align: center; padding: 40px !important; color: var(--text-light); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Form page */
.form-page { min-height: 100vh; background: var(--bg); }
.form-page .page-header { background: linear-gradient(135deg, var(--primary-dark), var(--primary-light)); padding: 30px 20px; color: #fff; }
.form-page .page-header h1 { font-size: 1.5rem; }
.form-card { background: var(--surface); border-radius: var(--radius); max-width: 700px; margin: -30px auto 40px; padding: 30px; box-shadow: var(--shadow-lg); position: relative; z-index: 1; }

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .header-top { flex-direction: column; gap: 12px; }
    #directory { grid-template-columns: 1fr; }
    .modal .form-row { grid-template-columns: 1fr; }
    .pending-card { flex-direction: column; align-items: flex-start; }
    .admin-table { font-size: 13px; }
    .admin-table th, .admin-table td { padding: 10px 8px; }
    .user-name { display: none; }
}
