@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #0a0f1a;
    --card-bg: rgba(22, 30, 46, 0.8);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --primary-glow: rgba(14, 165, 233, 0.4);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --error: #ef4444;
    --whatsapp: #25D366;
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image: radial-gradient(circle at 50% -20%, #1e3a8a 0%, transparent 50%);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header & Nav */
header {
    background: rgba(10, 15, 26, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo { max-width: 180px; height: auto; display: block; filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.3)); }

nav { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.nav-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1.2rem; border-radius: 50px; font-size: 0.9rem; font-weight: 500;
    text-decoration: none; transition: all 0.3s ease; color: var(--text);
    border: 1px solid transparent; white-space: nowrap;
}
.nav-btn:hover { background: rgba(255,255,255,0.05); border-color: var(--card-border); }
.nav-btn.login { 
    background: linear-gradient(135deg, #0ea5e9, #3b82f6); color: #fff; border: none;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.nav-btn.login:hover { background: linear-gradient(135deg, #0284c7, #2563eb); box-shadow: 0 6px 20px var(--primary-glow); transform: translateY(-1px); }
.nav-btn.logout { color: var(--error); border-color: rgba(239, 68, 68, 0.3); }
.nav-btn.logout:hover { background: rgba(239, 68, 68, 0.1); }

/* Layout */
.container { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; width: 100%; flex: 1; }
.card { 
    background: var(--card-bg); 
    backdrop-filter: blur(16px);
    border-radius: var(--radius); 
    padding: 2.5rem; 
    border: 1px solid var(--card-border); 
    margin-bottom: 2rem; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); 
    animation: fadeIn 0.5s ease-out;
}

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

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6); color: #fff; padding: 0.75rem 1.5rem;
    border: none; border-radius: 50px; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.btn:hover { 
    background: linear-gradient(135deg, #0284c7, #2563eb); 
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}
.btn:active { transform: translateY(0); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-whatsapp { background: linear-gradient(135deg, #25D366, #128C7E); }
.btn-whatsapp:hover { background: linear-gradient(135deg, #128C7E, #075E54); box-shadow: 0 0 20px rgba(37, 211, 102, 0.4); }

/* Forms */
input[type="text"], input[type="password"], input[type="file"] {
    width: 100%; padding: 0.9rem 1.2rem; border-radius: 12px; border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.3); color: var(--text); margin-bottom: 1rem; font-family: inherit; font-size: 16px;
    transition: all 0.3s ease;
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); background: rgba(0, 0, 0, 0.5); }
label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text-muted); font-size: 0.9rem; }

/* Alerts */
.alert { padding: 1rem 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; font-size: 0.95rem; border: 1px solid transparent; }
.alert.success { background: rgba(16, 185, 129, 0.1); color: #34d399; border-color: rgba(16, 185, 129, 0.2); }
.alert.error { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }

/* Dashboard Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.grid-item { 
    background: rgba(0, 0, 0, 0.2); border: 1px solid var(--card-border); border-radius: var(--radius); 
    padding: 1.2rem; text-align: center; display: flex; flex-direction: column; justify-content: space-between;
    transition: all 0.3s ease; position: relative; overflow: hidden;
}
.grid-item:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.15); }

.image-container {
    width: 100%; height: 220px; background: rgba(0,0,0,0.3); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.05); overflow: hidden;
}
.grid-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

.grid-item .meta { font-size: 0.8rem; color: var(--text); margin-bottom: 1rem; word-break: break-all; text-align: left; }
.grid-item .meta .filename { font-weight: 600; color: var(--primary); font-size: 0.9rem; margin-bottom: 0.2rem; display: block; }
.grid-item .meta .details { color: var(--text-muted); font-size: 0.75rem; }
.grid-item .actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.grid-item input[type="text"] { display: none; }

/* Tables (Admin) */
.table-responsive { overflow-x: auto; width: 100%; margin-top: 1rem; border-radius: 12px; border: 1px solid var(--card-border); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--card-border); }
th { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; background: rgba(0,0,0,0.2); }
select { padding: 0.4rem 0.8rem; border-radius: 8px; background: var(--bg); color: var(--text); border: 1px solid var(--border); }

/* Login Page */
.login-container { max-width: 440px; margin: 4rem auto; }
.login-logo { max-width: 220px; height: auto; margin-bottom: 1rem; filter: drop-shadow(0 0 15px rgba(14, 165, 233, 0.3)); }

/* Upload Dropzone */
#drop-zone {
    border: 2px dashed var(--border); border-radius: var(--radius); padding: 4rem 1rem;
    text-align: center; cursor: pointer; position: relative; margin-bottom: 1.5rem;
    transition: all 0.3s ease; background: rgba(0,0,0,0.1);
}
#drop-zone:hover { border-color: var(--primary); background: rgba(14, 165, 233, 0.05); }

/* Profile Card */
.profile-card {
    max-width: 500px; margin: 2rem auto;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(14, 165, 233, 0.3);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.1);
}
.profile-header { text-align: center; margin-bottom: 2rem; }
.profile-avatar {
    width: 110px; height: 110px; background: rgba(14, 165, 233, 0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem auto; border: 2px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow); overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem; border-bottom: 1px solid var(--card-border);
    background: rgba(0,0,0,0.2); margin-bottom: 1rem; border-radius: 10px;
}
.profile-info-item span:first-child { color: var(--text-muted); font-weight: 500; }
.profile-info-item span:last-child { font-weight: 600; color: var(--text); font-size: 1.1rem; }

/* Modal Popup */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; z-index: 1000;
    opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content {
    background: var(--card-bg); padding: 3rem 2rem; border-radius: var(--radius);
    border: 1px solid var(--card-border); text-align: center; max-width: 400px; width: 90%;
    transform: translateY(20px); transition: transform 0.3s ease;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-content h3 { font-size: 1.5rem; margin-bottom: 1rem; font-weight: 700; }
.modal-content p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.5; }
.modal-icon { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; display: block; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    header { flex-direction: column; align-items: center; padding: 1rem; }
    nav { justify-content: center; width: 100%; }
    .container { margin: 1rem auto; padding: 0 0.5rem; }
    .card { padding: 1.5rem; border-radius: 12px; }
    .logo { max-width: 150px; }
    .login-logo { max-width: 180px; }
    .btn { width: 100%; margin-bottom: 0.5rem; }
    .grid-item .actions { flex-direction: column; }
    .grid-item .actions .btn { width: 100%; margin-bottom: 0.25rem; }
    .dashboard-header { flex-direction: column; gap: 1rem; align-items: flex-start !important; }
    .grid { grid-template-columns: 1fr; }
    .profile-info-item { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}