/* ============================================
   admin.css — Admin Panel Styles
   ============================================ */

:root {
    --bg:           #0d0f13;
    --sidebar-bg:   #13151a;
    --card-bg:      rgba(255,255,255,0.03);
    --card-border:  rgba(255,255,255,0.07);
    --input-bg:     rgba(0,0,0,0.3);
    --accent:       #6366f1;
    --accent-2:     #ec4899;
    --green:        #10b981;
    --red:          #ef4444;
    --text:         #f1f5f9;
    --text-muted:   #64748b;
    --text-label:   #94a3b8;
    font-family: 'Inter', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); min-height: 100vh; }
h1,h2,h3,h4 { font-family: 'Outfit', sans-serif; }

/* ── Login Screen ── */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 60% 40%, rgba(99,102,241,0.12) 0%, transparent 65%),
                radial-gradient(ellipse at 20% 80%, rgba(236,72,153,0.08) 0%, transparent 50%);
}

.login-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

.login-icon { font-size: 3rem; margin-bottom: 1.2rem; line-height: 1; }
.login-card h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.4rem; }
.login-subtitle { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.95rem; }

.login-card .field-group { margin-bottom: 1rem; }
.login-card input[type="password"] {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    text-align: center;
    letter-spacing: 0.1em;
}
.login-card input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.default-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 1.5rem;
}
.default-hint code {
    background: rgba(255,255,255,0.08);
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.9em;
}

/* ── Buttons ── */
.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all .2s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary-admin {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
    width: 100%;
}
.btn-primary-admin:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-secondary-admin {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--card-border) !important;
}
.btn-secondary-admin:hover { background: rgba(255,255,255,0.12); }

.btn-danger-admin {
    background: rgba(239,68,68,0.12);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.3) !important;
    width: 100%;
}
.btn-danger-admin:hover { background: rgba(239,68,68,0.22); }

.btn-icon {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    line-height: 1;
    transition: background .2s;
    flex-shrink: 0;
}
.btn-danger-icon:hover { background: rgba(239,68,68,0.2); }

/* ── Dashboard Layout ── */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.4rem 1.2rem;
    border-bottom: 1px solid var(--card-border);
}
.sidebar-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all .2s;
}
.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
}
.sidebar-nav .nav-item.active {
    background: rgba(99,102,241,0.15);
    color: var(--accent);
    font-weight: 600;
}
.nav-icon { font-size: 1em; line-height: 1; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.view-site-btn {
    display: block;
    text-align: center;
    padding: 0.65rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background .2s;
}
.view-site-btn:hover { background: rgba(255,255,255,0.1); }

.logout-btn {
    width: 100%;
    padding: 0.65rem;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 10px;
    color: #f87171;
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}
.logout-btn:hover { background: rgba(239,68,68,0.18); }

/* Main Content */
.admin-main {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    min-height: 100vh;
    position: relative;
}

/* Sections */
.admin-section { display: none; animation: fadeIn .25s ease; }
.admin-section.active { display: block; }

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

.section-header { margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.75rem; margin-bottom: 0.3rem; }
.section-header p { color: var(--text-muted); font-size: 0.92rem; }

.section-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.section-actions .btn-admin { width: auto; }

/* Form Card */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}

.field-group { margin-bottom: 1.2rem; }
.field-group:last-child { margin-bottom: 0; }

.field-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-label);
    margin-bottom: 0.55rem;
}
.label-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.field-group input,
.field-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color .2s, box-shadow .2s;
    resize: vertical;
}
.field-group input:focus,
.field-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.field-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

/* Card Row (side-by-side fields) */
.card-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.card-row .field-group { flex: 1; min-width: 160px; margin-bottom: 0; }

/* Skill Items */
.skill-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1.2rem;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}
.skill-item .field-group { flex: 1; margin-bottom: 0; }

/* Project Items */
.project-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.project-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
}
.project-item-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Gradient Picker */
.gradient-picker {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}
.gradient-option {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform .2s, border-color .2s;
    flex-shrink: 0;
}
.gradient-option:hover { transform: scale(1.12); }
.gradient-option.selected { border-color: #fff; transform: scale(1.12); box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }

.gradient-1 { background: linear-gradient(135deg, #f6d365, #fda085); }
.gradient-2 { background: linear-gradient(135deg, #84fab0, #8fd3f4); }
.gradient-3 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.gradient-4 { background: linear-gradient(135deg, #fccb90, #d57eeb); }
.gradient-5 { background: linear-gradient(135deg, #43e97b, #38f9d7); }

/* Data Management Cards */
.data-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.data-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.data-card-icon { font-size: 2.5rem; margin-bottom: 1rem; line-height: 1; }
.data-card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.data-card p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.5rem; line-height: 1.5; flex: 1; }
.data-card code { background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.danger-card { border-color: rgba(239,68,68,0.25); background: rgba(239,68,68,0.03); }

/* Profile Photo Preview */
.profile-photo-preview {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.preview-ring {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--accent), #ec4899);
    flex-shrink: 0;
}

.preview-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(99,102,241,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.preview-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.divider-or {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.75rem 0;
}

/* Toast Notification */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    transform: translateY(80px);
    opacity: 0;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    z-index: 9999;
    pointer-events: none;
    backdrop-filter: blur(8px);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.4);
    color: #34d399;
}
.toast-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.4);
    color: #f87171;
}

/* ── Modal & Cropper ── */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    animation: fadeInModal .3s ease;
}

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

.modal-content {
    background: var(--sidebar-bg);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--card-border);
    width: 95%;
    max-width: 700px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 1.2rem; }

.close {
    color: var(--text-muted);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: color .2s;
}
.close:hover { color: var(--text); }

.cropper-container {
    padding: 20px;
    background: #000;
    min-height: 400px;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cropper-image {
    max-width: 100%;
    display: block;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-footer .btn-admin { width: auto; }

