@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,400&family=Poppins:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    --bg-primary: #090d16;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-glass: rgba(17, 24, 39, 0.65);
    --bg-input: rgba(15, 23, 42, 0.6);
    --bg-input-focus: rgba(30, 41, 59, 0.9);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.4);
    --glass-border: rgba(255, 255, 255, 0.12);
    
    --primary-blue: #3b82f6;
    --primary-indigo: #6366f1;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    --accent-glow: rgba(59, 130, 246, 0.25);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --resume-accent: #2563eb;
    --resume-accent-light: #eff6ff;
    --resume-font-heading: 'Poppins', sans-serif;
    --resume-font-body: 'Poppins', sans-serif;
}

[data-theme="light"] {
    --bg-primary: #f4f6fc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(241, 245, 249, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-input: #f8fafc;
    --bg-input-focus: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    --border-color: rgba(226, 232, 240, 0.9);
    --border-hover: rgba(37, 99, 235, 0.5);
    --glass-border: rgba(255, 255, 255, 0.8);
    
    --accent-glow: rgba(37, 99, 235, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(149, 157, 165, 0.1);
    --shadow-lg: 0 16px 40px rgba(100, 116, 139, 0.12);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.bg-glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: orbFloat 20s infinite ease-in-out alternate;
}

.bg-orb-1 {
    width: 450px;
    height: 450px;
    background: #3b82f6;
    top: -100px;
    left: -100px;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: #7c3aed;
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 350px;
    height: 350px;
    background: #06b6d4;
    top: 40%;
    left: 45%;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.1); }
    100% { transform: translate(-40px, 80px) scale(0.95); }
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-normal);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: var(--shadow-glow);
}

.brand-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand-tag {
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-blue);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.825rem;
    border-radius: var(--radius-sm);
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    background-color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.completeness-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.completeness-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.completeness-text span {
    font-weight: 700;
    color: var(--primary-blue);
}

.progress-bar-mini {
    width: 70px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.app-container {
    display: grid;
    grid-template-columns: 52% 48%;
    min-height: calc(100vh - 65px);
    max-width: 1800px;
    margin: 0 auto;
}

.editor-panel {
    padding: 1.75rem 2rem;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    max-height: calc(100vh - 65px);
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.editor-title-group h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.editor-title-group p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.editor-tools {
    display: flex;
    gap: 0.5rem;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.section-title i {
    color: var(--primary-blue);
    font-size: 1.2rem;
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.glass-card.collapsed .section-content {
    display: none;
}

.glass-card.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-content {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-group-full {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    outline: none;
}

.input-control:focus {
    border-color: var(--primary-blue);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.input-control {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

.photo-upload-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.photo-preview {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-ai {
    background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    font-size: 0.775rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.btn-ai:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.45);
}

.dynamic-item {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    margin-bottom: 1rem;
    position: relative;
    transition: var(--transition-fast);
}

.dynamic-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
}

.item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.item-remove-btn {
    color: var(--danger);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.item-remove-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 48px;
    align-items: center;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 500;
}

.tag-remove {
    cursor: pointer;
    opacity: 0.7;
    font-size: 0.75rem;
}

.tag-remove:hover {
    opacity: 1;
}

.tag-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    flex-grow: 1;
    min-width: 120px;
}

.preview-panel {
    background: rgba(5, 8, 15, 0.5);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    overflow-x: auto;
    max-height: calc(100vh - 65px);
    position: sticky;
    top: 65px;
}

.preview-toolbar {
    width: 100%;
    max-width: 820px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    gap: 1rem;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: auto;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toolbar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.select-control {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.color-swatches {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease;
}

.swatch:hover {
    transform: scale(1.15);
}

.swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.resume-paper-wrapper {
    width: 100%;
    min-width: fit-content;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    perspective: 1000px;
    padding: 0 2rem 3rem 2rem;
    margin: 0 auto;
}

.resume-paper {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    transition: transform 0.3s ease;
    transform-origin: top center;
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
    flex-shrink: 0;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.ai-suggestion-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
    line-height: 1.6;
}

.ai-suggestion-card:hover {
    border-color: var(--primary-blue);
    background: var(--bg-input-focus);
    transform: translateX(4px);
}

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast i {
    font-size: 1.1rem;
    color: var(--primary-blue);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
