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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent; /* Controlled by neon-final.css */
    color: inherit;          /* Controlled by neon-final.css */
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    width: 100%;
}

.page {
    display: none;
    width: 100%;
    min-height: 100vh;
    padding: 0; /* Removed - neon-final.css handles spacing */
}

.page.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: transparent; /* Controlled by neon-final.css */
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

h2 {
    color: inherit; /* Controlled by neon-final.css */
    margin: 20px 0 10px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    padding-bottom: 8px;
    font-weight: 600;
}

/* Modern Login Page */
.modern-login {
    max-width: 400px;
    width: 100%;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    text-align: center;
    transition: transform 0.3s ease;
}

.modern-login:hover {
    transform: translateY(-5px);
}

.quadr-style {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #f8f9ff;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 65px rgba(15, 23, 42, 0.4);
    overflow: hidden;
}

.quadr-style::before,
.quadr-style::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 30%;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(5px);
}

.quadr-style::before {
    top: -80px;
    right: -60px;
}

.quadr-style::after {
    bottom: -90px;
    left: -70px;
}

.login-header h1 {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.login-header p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin: 10px 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.login-footer {
    margin-top: 20px;
}

.login-footer a {
    color: #3498db;
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Register Page */
.register-container {
    max-width: 400px;
    width: 100%;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    text-align: center;
}

.register-container h1 {
    color: #3498db;
    margin-bottom: 10px;
}

.register-container input {
    width: 100%;
    padding: 15px;
    margin: 15px 0;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
}

.register-container button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin: 15px 0;
}

.register-container a {
    color: #3498db;
    font-weight: 600;
    text-decoration: none;
}

/* Resume Form Page */
.form-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    padding: 60px 40px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
}

.form-container h1 {
    color: #1a1a1a;
    margin: 0;
    text-align: left;
    font-size: 32px;
    font-weight: 700;
}

.form-container h2 {
    color: #1a1a1a;
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 20px;
    font-weight: 600;
}

.input-group-full {
    margin-bottom: 20px;
}

.input-group-full label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

/* Input with label wrapper */
.input-with-label {
    margin-bottom: 15px;
}

.input-with-label label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

/* Dark mode label styling */
body.dark-mode .input-group-full label,
body.dark-mode .input-with-label label {
    color: #e5e7eb;
}

body.dark-mode .input-grid .input-group-full label {
    color: #e5e7eb;
}

/* Dark mode small text */
body.dark-mode small {
    color: #9ca3af !important;
}

/* Dark mode form headings */
body.dark-mode .form-container h2 {
    color: #f3f4f6;
    border-bottom-color: #374151;
}

/* Dark mode placeholder text */
body.dark-mode .form-container input::placeholder,
body.dark-mode .form-container textarea::placeholder {
    color: #94a3b8;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.form-header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.compact-btn {
    padding: 10px 18px;
    font-size: 14px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #5f6c80;
    user-select: none;
}

.theme-toggle input {
    display: none;
}

.toggle-track {
    width: 48px;
    height: 26px;
    border-radius: 999px;
    background: #cfd8f0;
    display: inline-flex;
    align-items: center;
    padding: 3px;
    transition: background 0.3s ease;
}

.toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.theme-toggle input:checked + .toggle-track {
    background: #3498db;
}

.theme-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(22px);
}

.theme-toggle-label {
    font-size: 0.95rem;
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="tel"],
.form-container input[type="url"],
.form-container input[type="password"],
.form-container textarea,
.form-container select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    background: #ffffff;
    color: #2c3e50;
    transition: all 0.25s ease;
    margin-bottom: 18px;
    font-family: inherit;
}

.form-container textarea {
    min-height: 120px;
    resize: vertical;
}

.form-container input::placeholder,
.form-container textarea::placeholder {
    color: #9aa9bc;
    transition: opacity 0.25s ease;
}

.form-container input:focus::placeholder,
.form-container textarea:focus::placeholder {
    opacity: 0.5;
}

.form-container input:focus,
.form-container textarea:focus,
.form-container select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    transform: translateY(-1px);
}

.input-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.input-grid .input-group-full {
    flex: 1 1 240px;
    margin-bottom: 0;
}

.input-grid .input-group-full label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.input-grid input,
.input-grid textarea,
.input-grid select {
    flex: 1 1 240px;
    margin-bottom: 0;
}

.customization-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 15px;
    background: #f1f5ff;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #43506b;
}

.customization-toggle input {
    margin-right: 8px;
}

.customization-panel {
    display: none;
    border: 2px dashed #cfd8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.6);
}

.customization-panel.active {
    display: block;
}

.customization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.customization-grid label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.customization-grid input[type="color"] {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: #f0f4ff;
    cursor: pointer;
}

.customization-sliders {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.customization-sliders label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: #2c3e50;
}

.customization-sliders input[type="range"] {
    width: 100%;
}

.secondary-btn {
    background: transparent;
    border: 1px solid rgba(67, 80, 107, 0.4);
    color: #43506b;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.custom-template-form {
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    background: rgba(52, 152, 219, 0.05);
}

.education-entry, .project-entry, .achievement-entry, .activity-entry, .hobby-entry, .experience-entry {
    background: transparent; /* Controlled by neon-final.css */
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.education-entry:hover, .project-entry:hover, .achievement-entry:hover, .activity-entry:hover, .hobby-entry:hover, .experience-entry:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left-color: #2563eb;
}

.add-btn {
    background: #2ecc71;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin: 10px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
    display: inline-block;
}

.add-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.add-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

.remove-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.remove-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
}

.remove-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    margin: 30px auto;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.submit-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

/* Resume Preview Page */
.preview-container {
    max-width: 1000px;
    width: 100%;
    margin: 20px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.resume-actions {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.resume-actions button {
    background: #3498db;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin: 0 10px;
    transition: background 0.3s ease;
}

.resume-actions button:hover {
    background: #2980b9;
}

.resume-template {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

/* Resume Template Styles */
.resume-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.resume-name {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.resume-contact {
    font-size: 14px;
    margin-top: 5px;
}

.resume-section {
    margin: 20px 0;
}

.resume-section h3 {
    font-size: 20px;
    color: #3498db;
    border-bottom: 1px solid rgba(52, 152, 219, 0.2);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.resume-list {
    padding-left: 20px;
}

.resume-list li {
    margin: 8px 0;
}

.education-item {
    margin-bottom: 15px;
}

.education-item strong {
    display: block;
}

/* Template Selection */
#resume-template {
    width: 100%;
    padding: 15px;
    margin: 15px 0;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    transition: border-color 0.3s ease;
}

.section-handle {
    cursor: grab;
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    user-select: none;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #475569;
    border: 1px solid #e5e7eb;
}

.section-handle:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.section-handle:active {
    cursor: grabbing;
}

#resume-template:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

#add-education,
#add-project,
#add-achievement,
#add-activity,
#add-hobby,
#add-experience {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2ecc71;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 0 20px;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

#add-education:hover,
#add-project:hover,
#add-achievement:hover,
#add-activity:hover,
#add-hobby:hover,
#add-experience:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

#add-education:active,
#add-project:active,
#add-achievement:active,
#add-activity:active,
#add-hobby:active,
#add-experience:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

/* Template Preview */
.template-picker-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    color: #5f6c80;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.template-count-pill {
    background: rgba(255, 255, 255, 0.8);
    color: #5f2eea;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(94, 46, 234, 0.2);
}

/* Template Selection Notice */
.template-selection-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    margin: 20px 0 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.template-selection-notice .notice-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    animation: bounce 1.5s ease-in-out infinite;
}

.template-selection-notice p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.5);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Hide notice when form sections are visible */
#form-sections:not([style*="display: none"]) ~ * .template-selection-notice,
.template-selection-notice.hidden {
    display: none;
}

/* Selected Template Info Bar */
.selected-template-info {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    flex-wrap: wrap;
    gap: 15px;
}

.selected-template-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
}

.selected-icon {
    background: white;
    color: #10b981;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.change-template-btn {
    background: white;
    color: #059669;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.change-template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #f0fdf4;
}

.change-template-btn:active {
    transform: translateY(0);
}

.template-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px 0 40px;
}

.template-card {
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.template-card::after {
    content: none;
}

.template-card-inner {
    display: none;
}

.template-thumbnail {
    position: relative;
    overflow: hidden;
}

.template-info {
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.template-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.template-card p {
    margin: 0;
    font-size: 13px;
}

.template-card .template-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.template-card .badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.preview-btn {
    background: white;
    color: #3b82f6;
    border: 1px solid #e5e7eb;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
    margin-top: 12px;
}

.preview-btn:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Use Template Button */
.use-template-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    width: 100%;
    margin-top: 12px;
}

.use-template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.use-template-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.template-card.active {
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.3);
    border: 2px solid #3b82f6;
}

/* Photo Upload */
.photo-upload-container {
    border: 2px dashed #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    transition: border-color 0.3s ease;
}

.photo-upload-container:hover {
    border-color: #3498db;
}

.photo-upload-label {
    display: block;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.photo-upload-label:hover {
    background: #e9ecef;
}

.photo-preview {
    max-width: 200px;
    max-height: 200px;
    margin: 15px auto;
    display: block;
    border-radius: 8px;
}

/* Template Preview Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: #ffffff;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h2 {
    margin: 0;
    padding: 24px 32px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    border-radius: 16px 16px 0 0;
}

.modal-content > p {
    padding: 0 32px;
    margin: 16px 0;
    color: #64748b;
    font-size: 14px;
}

#template-preview-content {
    padding: 32px;
    background: white;
    border-radius: 0 0 16px 16px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.close-modal:hover {
    background: #f1f5f9;
    color: #1a1a1a;
    transform: rotate(90deg);
}

/* History Page */
.history-item {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
}

.history-item h3 {
    margin: 0;
    color: #1f2933;
}

.history-meta {
    font-size: 0.9rem;
    color: #6b7688;
}

.history-item button {
    margin: 0 5px;
}

.view-resume-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.view-resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.delete-resume-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.delete-resume-btn:hover {
    background: #c0392b;
}

.history-empty-state,
#no-history-message {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 30px;
    border: 1px dashed rgba(127, 140, 141, 0.4);
    border-radius: 16px;
    margin-top: 20px;
}

/* Dark Mode */
body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark-mode .container,
body.dark-mode .form-container,
body.dark-mode .preview-container,
body.dark-mode .history-item,
body.dark-mode .modal-content {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
    box-shadow: none;
}

body.dark-mode .modal {
    background: rgba(0, 0, 0, 0.85);
}

body.dark-mode .modal-content {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode .modal-content h2 {
    background: #0f172a;
    color: #f1f5f9;
    border-bottom-color: #334155;
}

body.dark-mode .modal-content > p {
    color: #94a3b8;
}

body.dark-mode #template-preview-content {
    background: #1e293b;
}

body.dark-mode .close-modal {
    color: #94a3b8;
}

body.dark-mode .close-modal:hover {
    background: #334155;
    color: #f1f5f9;
}

body.dark-mode .form-header {
    border-bottom-color: #334155;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode .form-container h1,
body.dark-mode .form-container h2 {
    color: #f1f5f9;
}

body.dark-mode h2 {
    border-bottom-color: #334155;
}

body.dark-mode .form-container h2 {
    border-bottom-color: #334155;
}

body.dark-mode .form-header {
    border-bottom-color: #334155;
}

body.dark-mode .theme-toggle-label {
    color: #f1f5f9;
}

body.dark-mode .form-container input[type="text"],
body.dark-mode .form-container input[type="email"],
body.dark-mode .form-container input[type="tel"],
body.dark-mode .form-container input[type="url"],
body.dark-mode .form-container input[type="password"],
body.dark-mode .form-container textarea,
body.dark-mode .form-container select {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

/* Ensure new input fields also have dark mode styling */
body.dark-mode .education-entry input[type="text"],
body.dark-mode .education-entry textarea,
body.dark-mode .experience-entry input[type="text"],
body.dark-mode .experience-entry textarea,
body.dark-mode .project-entry input[type="text"],
body.dark-mode .project-entry textarea,
body.dark-mode .achievement-entry input[type="text"] {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .form-container input:focus,
body.dark-mode .form-container textarea:focus,
body.dark-mode .form-container select:focus {
    border-color: #3b82f6;
    background: #0f172a;
}

body.dark-mode .form-container input::placeholder,
body.dark-mode .form-container textarea::placeholder {
    color: rgba(226, 232, 240, 0.6);
}

body.dark-mode .education-entry,
body.dark-mode .project-entry,
body.dark-mode .achievement-entry,
body.dark-mode .activity-entry,
body.dark-mode .hobby-entry,
body.dark-mode .experience-entry {
    background: #1e293b;
    border-left-color: #3b82f6;
    border-color: #334155;
}

body.dark-mode .education-entry:hover,
body.dark-mode .project-entry:hover,
body.dark-mode .achievement-entry:hover,
body.dark-mode .activity-entry:hover,
body.dark-mode .hobby-entry:hover,
body.dark-mode .experience-entry:hover {
    border-left-color: #60a5fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .section-handle {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark-mode .section-handle:hover {
    background: #334155;
    border-color: #475569;
}

body.dark-mode .resume-section h3 {
    border-bottom-color: rgba(165, 200, 255, 0.3);
}

body.dark-mode .photo-upload-container {
    border-color: rgba(148, 163, 184, 0.6);
}

body.dark-mode .photo-upload-label {
    background: rgba(148, 163, 184, 0.08);
}

body.dark-mode .resume-actions {
    background: rgba(148, 163, 184, 0.08);
}

body.dark-mode .login-btn,
body.dark-mode .register-container button,
body.dark-mode .submit-btn,
body.dark-mode .add-btn,
body.dark-mode .view-resume-btn {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
}

body.dark-mode .history-empty-state,
body.dark-mode #no-history-message {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(226, 232, 240, 0.75);
}

body.dark-mode .template-card {
    background: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border-color: transparent;
}

body.dark-mode .template-info {
    background: #1e293b;
}

body.dark-mode .template-info h3 {
    color: #f1f5f9;
}

body.dark-mode .template-info p {
    color: #94a3b8;
}

body.dark-mode .preview-btn {
    background: #334155;
    color: #60a5fa;
    border-color: #475569;
}

body.dark-mode .preview-btn:hover {
    background: #3b82f6;
    color: white;
}

body.dark-mode .template-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: #3b82f6;
}

body.dark-mode .template-card.active {
    border-color: #3b82f6;
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.3);
}

/* Print styles for PDF */
@media print {
    .resume-actions {
        display: none;
    }
    
    .preview-container {
        box-shadow: none;
        padding: 0;
    }
    
    body {
        background: white;
    }
    
    /* Specific styles for printed resume */
    .resume-template {
        box-shadow: none;
        padding: 20px;
    }
    
    /* Ensure background images and colors print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* A4 Print-Friendly CSS */
@media print {
    @page {
        size: A4;
        margin: 0;
    }
    
    body {
        margin: 0;
        padding: 0;
        background: white;
    }
}

/* A4 Container for Preview (794px x 1123px) */
.a4-container {
    width: 794px;
    height: 1123px;
    margin: 20px auto;
    padding: 40px;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    page-break-after: always;
}

@media screen and (max-width: 900px) {
    .a4-container {
        width: 100%;
        height: auto;
        margin: 10px;
        padding: 20px;
    }
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    margin-top: 60px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-text {
    font-size: 18px;
    margin: 0 0 10px 0;
    font-weight: 500;
}

.footer-text strong {
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.footer-copyright {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
}

/* Dark Mode Footer */
body.dark-mode .site-footer {
    background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

@media screen and (max-width: 768px) {
    .site-footer {
        padding: 20px 15px;
        margin-top: 40px;
    }
    
    .footer-text {
        font-size: 16px;
    }
    
    .footer-copyright {
        font-size: 12px;
    }
}