:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-app: #020617;
    --bg-sidebar: rgba(15, 23, 42, 0.8);
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.02);
    --glass-hover: rgba(255, 255, 255, 0.05);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Editor Sidebar */
.editor-sidebar {
    width: 400px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 10;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.logo h1 {
    font-family: 'Outfit';
    font-size: 1.2rem;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-sections {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.form-sections::-webkit-scrollbar {
    width: 5px;
}

.form-sections::-webkit-scrollbar-track {
    background: transparent;
}

.form-sections::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.form-sections::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.form-group {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.form-group:hover {
    background: var(--glass-hover);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.form-group h3 {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    margin-bottom: 0.75rem;
    outline: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

textarea {
    height: 80px;
    resize: none;
    line-height: 1.5;
}

.template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.tpl-btn {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
}

.tpl-btn.active {
    background: var(--primary);
}

.primary-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}

.secondary-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.remove-project-btn {
    background-color: rgba(155, 15, 15, 0.511);
}

/* Hover state already handled above */

.remove-project-btn:hover {
    background-color: rgba(155, 15, 15, 0.511);
}

.status-indicator {
    font-size: 0.7rem;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.8;
}

.status-indicator.ready {
    color: #34d399;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

.status-indicator.error {
    color: #f87171;
}

/* Preview Area */
.preview-area {
    flex: 1;
    background: #020617;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.preview-badge {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
}

.preview-viewport {
    flex: 1;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    scroll-behavior: smooth;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), 0 18px 36px -18px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
}

.portfolio-web-output {
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.p-section {
    padding: 80px 40px;
}

.p-section-title {
    font-family: 'Outfit';
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Themes Styling */

/* Modern Dark Theme */
.theme-modern {
    background: radial-gradient(circle at 0% 0%, #1e1b4b 0%, #0f172a 50%, #020617 100%);
    color: white;
}

.theme-modern .p-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-modern .p-brand {
    font-weight: 800;
    font-size: 1.4rem;
    font-family: 'Outfit';
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-modern .p-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.theme-modern .p-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.theme-modern .p-links a:hover {
    color: #818cf8;
}

.theme-modern .p-hero {
    text-align: center;
    padding: 160px 40px;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

.theme-modern h1 {
    font-size: 6rem;
    font-family: 'Outfit';
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.9;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.theme-modern h2 {
    color: #818cf8;
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.theme-modern .p-btn-main {
    display: inline-block;
    margin-top: 3.5rem;
    padding: 1.25rem 3rem;
    background: #6366f1;
    color: white;
    text-decoration: none;
    border-radius: 100px;
    font-weight: 600;
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-modern .p-btn-main:hover {
    transform: translateY(-5px) scale(1.05);
    background: #4f46e5;
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.5);
}

.theme-modern .p-grid-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.theme-modern .skill-tag {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.6rem 1.5rem;
    border-radius: 100px;
    color: #a5b4fc;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.theme-modern .skill-tag:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}

.theme-modern .p-projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.theme-modern .project-card {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
    padding: 3rem;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
}

.theme-modern .project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.5s;
}

.theme-modern .project-card:hover {
    transform: translateY(-12px);
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
}

.theme-modern .project-card:hover::before {
    opacity: 1;
}

.theme-modern .project-card h4 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-family: 'Outfit';
    color: white;
}

.theme-modern .project-card p {
    color: #94a3b8;
    line-height: 1.7;
    font-size: 1rem;
}

.theme-modern .p-exp-card {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.02) 100%);
    padding: 3rem;
    border-left: 4px solid #6366f1;
    border-radius: 0 32px 32px 0;
    transition: all 0.3s;
}

.theme-modern .p-exp-card:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.theme-modern .p-footer {
    padding: 4rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #64748b;
}

.theme-modern .p-social {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.theme-modern .p-social a {
    color: #94a3b8;
    text-decoration: none;
}

/* Minimal Light Theme */
.theme-minimal {
    background: #fafafa;
    color: #1a1a1a;
}

.theme-minimal .p-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 5rem;
    border-bottom: 1px solid #eee;
    background: white;
}

.theme-minimal .p-brand {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 1.1rem;
    color: #000;
}

.theme-minimal .p-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.theme-minimal .p-links a {
    color: #666;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    transition: color 0.3s;
}

.theme-minimal .p-links a:hover {
    color: #000;
}

.theme-minimal .p-hero {
    padding: 160px 40px;
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.theme-minimal h1 {
    font-size: 5rem;
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #000;
    letter-spacing: -0.02em;
}

.theme-minimal h2 {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 3rem;
}

.theme-minimal .skill-tag {
    border: 1px solid #eee;
    background: white;
    margin: 0 0.75rem 0.75rem 0;
    padding: 0.75rem 1.5rem;
    display: inline-block;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.theme-minimal .skill-tag:hover {
    border-color: #000;
    transform: translateY(-2px);
}

.theme-minimal .project-card {
    border: 1px solid #eee;
    background: white;
    padding: 4rem;
    border-radius: 4px;
    margin-bottom: 3rem;
    transition: all 0.4s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.theme-minimal .project-card:hover {
    border-color: #000;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    transform: translateY(-4px);
}

.theme-minimal .p-btn-main {
    display: inline-block;
    padding: 1.25rem 3rem;
    background: #000;
    color: white;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    margin-top: 3rem;
    transition: all 0.3s;
}

.theme-minimal .p-btn-main:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Gradient Theme */
.theme-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #db2777 100%);
    color: white;
}

.theme-gradient .p-nav {
    padding: 2.5rem;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-gradient .p-links {
    display: flex;
    gap: 3rem;
    list-style: none;
    margin-top: 1rem;
}

.theme-gradient .p-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.theme-gradient .p-links a:hover {
    color: white;
}

.theme-gradient .p-brand {
    font-size: 2.5rem;
    font-family: 'Outfit';
    font-weight: 900;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.03em;
}

.theme-gradient .p-section {
    background: rgba(255, 255, 255, 0.08);
    margin: 3rem 2rem;
    padding: 6rem 4rem;
    border-radius: 40px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.theme-gradient .p-hero {
    text-align: center;
}

.theme-gradient h1 {
    font-size: 5.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
}

.theme-gradient h2 {
    font-size: 2rem;
    opacity: 0.9;
    font-weight: 500;
}

.theme-gradient .p-btn-main {
    background: white;
    color: #4f46e5;
    padding: 1.25rem 3.5rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 800;
    display: inline-block;
    transition: all 0.4s;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.2);
}

.theme-gradient .p-btn-main:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 25px 50px -10px rgba(255, 255, 255, 0.3);
}

.theme-gradient .skill-tag {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.75rem 1.75rem;
    border-radius: 16px;
    margin: 0.5rem;
    display: inline-block;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.theme-gradient .skill-tag:hover {
    background: white;
    color: #7c3aed;
    transform: rotate(-2deg);
}

.theme-gradient .project-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s;
}

.theme-gradient .project-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-10px) rotate(1deg);
    border-color: white;
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.p-section,
.p-hero {
    animation: fadeInUp 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}