/* ================= VARIABLES & THEMES ================= */
:root {
    --bg-main: #000000;
    --bg-surface: #0a0a0a;
    --bg-panel: #111111;
    --primary: #2563eb;
    --primary-hover: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.4);
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-color: rgba(255, 255, 255, 0.08);
    --radius-md: 12px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', sans-serif;
}

[data-theme="blue"] {
    --bg-main: #020617; --bg-surface: #0f172a; --bg-panel: #1e293b;
    --primary: #0ea5e9; --primary-hover: #38bdf8; --primary-glow: rgba(14, 165, 233, 0.4);
}

[data-theme="purple"] {
    --bg-main: #0a0014; --bg-surface: #130024; --bg-panel: #1d0033;
    --primary: #8b5cf6; --primary-hover: #a78bfa; --primary-glow: rgba(139, 92, 246, 0.4);
}

[data-theme="elegant"] {
    --bg-main: #111111; --bg-surface: #1a1a1a; --bg-panel: #222222;
    --primary: #ffffff; --primary-hover: #e5e5e5; --primary-glow: rgba(255, 255, 255, 0.2);
    --text-main: #ffffff;
}

/* ================= RESET & BASE ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font); background-color: var(--bg-main); color: var(--text-main);
    min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; transition: var(--transition);
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--bg-panel); border-radius: 4px; }

/* ================= HEADER ================= */
.top-nav {
    height: 70px; display: flex; justify-content: space-between; align-items: center;
    padding: 0 5%; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.brand-icon { color: var(--primary); font-size: 1.5rem; text-shadow: 0 0 10px var(--primary-glow); }

/* ================= BUTTONS ================= */
button { font-family: var(--font); cursor: pointer; border: none; outline: none; transition: var(--transition); }
.btn-primary { background: var(--primary); color: #fff; padding: 12px 24px; border-radius: var(--radius-md); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 20px var(--primary-glow); }
.btn-primary[data-theme="elegant"] { color: #000; }
.btn-primary-small { background: rgba(255,255,255,0.05); color: var(--text-main); padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; display: flex; gap: 6px; border: 1px solid var(--border-color); }
.btn-primary-small:hover { background: var(--primary); border-color: var(--primary); }
.btn-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); padding: 8px 16px; border-radius: 8px; display: flex; gap: 8px; font-weight: 500; }
.btn-secondary:hover { background: var(--bg-panel); }
.btn-white { background: #fff; color: #000; padding: 10px 20px; font-weight: 600; border-radius: 50px; font-size: 0.9rem; }
.btn-white:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(255,255,255,0.3); }
.icon-btn { background: transparent; color: var(--text-muted); font-size: 1.2rem; }
.icon-btn:hover { color: #fff; }
.w-100 { width: 100%; }
.mt-auto { margin-top: auto; }

/* ================= WORKSPACE ================= */
.workspace { flex: 1; display: flex; padding: 2rem 5%; gap: 2rem; height: calc(100vh - 140px); }

/* EDITOR PANEL */
.editor-panel {
    flex: 1; max-width: 450px; background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem;
    overflow-y: auto; position: relative; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.panel-header h2 { font-size: 1.5rem; margin-bottom: 5px; }
.panel-header p { color: var(--text-muted); font-size: 0.9rem; }

/* AVATAR UPLOAD */
.avatar-section { display: flex; flex-direction: column; align-items: center; gap: 15px; padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.avatar-preview-container {
    width: 120px; height: 120px; border-radius: 50%; border: 2px dashed var(--border-color);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    background: var(--bg-panel); box-shadow: 0 0 20px var(--primary-glow); position: relative;
}
.avatar-preview-container img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { font-size: 3rem; color: var(--text-muted); }

/* FORMS */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
input, textarea, select {
    background: var(--bg-panel); border: 1px solid var(--border-color); color: var(--text-main);
    padding: 12px 16px; border-radius: 8px; font-family: var(--font); font-size: 0.95rem; outline: none; transition: var(--transition);
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
textarea { resize: vertical; }

/* LINKS SECTION */
.links-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.links-list { display: flex; flex-direction: column; gap: 10px; }
.link-item { background: var(--bg-panel); padding: 12px 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border-color); }
.link-item-info { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }

/* PREVIEW PANEL */
.preview-panel {
    flex: 2; background: url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="rgba(255,255,255,0.05)"/></svg>');
    border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); position: relative; overflow: hidden; padding: 2rem;
}
.preview-panel::before {
    content: ''; position: absolute; width: 400px; height: 400px; background: var(--primary);
    filter: blur(150px); opacity: 0.15; border-radius: 50%; z-index: 0;
}
.preview-wrapper {
    background: var(--bg-surface); width: 100%; max-width: 480px; height: 100%; max-height: 800px;
    border-radius: 24px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    overflow-y: auto; position: relative; z-index: 1; padding: 3rem 2rem;
}
.preview-content { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pv-avatar { width: 100px; height: 100px; border-radius: 50%; border: 2px solid var(--border-color); background: var(--bg-panel); margin-bottom: 1.5rem; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pv-avatar i { font-size: 2.5rem; color: var(--text-muted); }
#pv-name { font-size: 1.8rem; font-weight: 700; margin-bottom: 5px; }
#pv-role { font-size: 1rem; color: var(--primary); margin-bottom: 1.5rem; font-weight: 500; }
#pv-bio { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 2rem; }
.pv-skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 2rem; }
.skill-tag { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; color: var(--text-muted); }
.pv-links { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.pv-link-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main); text-decoration: none; border-radius: 12px; font-weight: 500; transition: var(--transition);
}
.pv-link-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); border-color: rgba(255,255,255,0.2); }

/* ================= MODAL ================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { background: var(--bg-surface); border: 1px solid var(--border-color); width: 90%; max-width: 400px; border-radius: var(--radius-md); transform: translateY(20px); transition: 0.3s; box-shadow: 0 25px 50px rgba(0,0,0,0.5); }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.modal-footer { padding: 20px; border-top: 1px solid var(--border-color); }

/* ================= TOASTS ================= */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(20, 20, 20, 0.9); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 14px 20px; border-radius: 12px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: slideInRight 0.3s forwards, fadeOut 0.3s 2.7s forwards; }
.toast i { color: var(--primary); font-size: 1.2rem; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* ================= FOOTER ================= */
.global-footer { border-top: 1px solid var(--border-color); padding: 20px 5%; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-muted); background: var(--bg-main); height: 70px; }
.global-footer span { color: var(--text-main); font-weight: 600; }
.footer-socials { display: flex; gap: 15px; }
.footer-socials a { color: var(--text-muted); font-size: 1.2rem; transition: var(--transition); }
.footer-socials a:hover { color: var(--text-main); text-shadow: 0 0 10px rgba(255,255,255,0.5); transform: translateY(-2px); }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
    .workspace { flex-direction: column; height: auto; padding: 1rem; }
    .editor-panel { max-width: 100%; }
    .global-footer { flex-direction: column; gap: 15px; height: auto; text-align: center; padding: 20px 1rem; }
}
