/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0b63d1; /* stronger blue */
    --secondary: #6f42c1;
    --text: #0f1720; /* darker text for contrast */
    --text-light: #374151; /* readable secondary text */
    --border: #d1d5db;
    --bg: #ffffff;
    --bg-light: #f8fafc;
    --accent: #0f9d58; /* greener accent with good contrast */
    --muted: #6b7280;

    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* Accessible focus outlines for keyboard users */
:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 75%, transparent);
    outline-offset: 2px;
}

.container {
    width: 100%;
    min-height: 100vh;
}

/* ========== LANDING PAGE ========== */
.landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.landing-content {
    text-align: center;
    color: white;
    max-width: 600px;
    background: rgba(0,0,0,0.36);
    padding: 28px 30px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(2,6,23,0.35);
}

.landing-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.6s ease-out;
}

.landing-content p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.95;
    animation: slideUp 0.6s ease-out 0.1s both;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    animation: slideUp 0.6s ease-out 0.2s both;
}

.username-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: #ffffff;
    color: var(--text);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.username-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(15,157,88,0.18);
    transform: translateY(-2px);
}

.username-input::placeholder {
    color: var(--muted);
}

.generate-btn {
    padding: 15px 35px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
}

.generate-btn:hover {
    background: color-mix(in srgb, var(--accent) 78%, black 10%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.generate-btn:active {
    transform: translateY(0);
}

/* Explicit focus styles for interactive elements (fallback for older browsers) */
button:focus, a:focus, input:focus, textarea:focus, select:focus {
    outline: 3px solid rgba(15,157,88,0.18);
    outline-offset: 2px;
}

.info-text {
    margin-bottom: 50px;
    font-size: 0.95rem;
    opacity: 0.9;
    animation: slideUp 0.6s ease-out 0.3s both;
}

.templates-section {
    animation: slideUp 0.6s ease-out 0.4s both;
}

.templates-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.template-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.template-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: var(--transition);
}

.template-option:hover {
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(2,6,23,0.06);
}

.template-option input[type="radio"] {
    cursor: pointer;
}

.template-option span {
    font-weight: 500;
}

/* ========== PORTFOLIO PAGE ========== */
.portfolio-page {
    min-height: 100vh;
    background: var(--bg);
    position: relative;
}

.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    padding: 10px 15px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.portfolio-controls {
    display: flex;
    gap: 10px;
}

.export-btn, .share-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(3, 102, 214, 0.25);
}

.export-btn:hover, .share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(3, 102, 214, 0.35);
}

.preview-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.25);
}

.preview-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(23, 162, 184, 0.35);
}

/* Default (Preview / Export mode) */
.portfolio-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Editor-only layout */
body.editor-mode .portfolio-container {
    margin-right: 380px;
}


/* ========== SECTIONS ========== */
.section {
    margin-bottom: 50px;
    animation: fadeInUp 0.6s ease-out;
}

.section h2 {
    font-size: 2.3rem;
    margin-bottom: 30px;
    color: var(--text);
    border-bottom: 4px solid var(--primary);
    padding-bottom: 15px;
    display: inline-block;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 80px;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(3, 102, 214, 0.05), rgba(111, 66, 193, 0.05));
    border-radius: 15px;
    border: 2px solid rgba(3, 102, 214, 0.1);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--primary);
    box-shadow: 0 20px 60px rgba(3, 102, 214, 0.3);
    transition: var(--transition);
    cursor: pointer;
}

.avatar:hover {
    transform: scale(1.08) rotate(-5deg);
    box-shadow: 0 25px 70px rgba(3, 102, 214, 0.4);
}

.hero-section h1 {
    font-size: 3.5rem;
    color: var(--text);
    font-weight: 800;
    margin: 0;
}

.hero-section .bio {
    font-size: 1.3rem;
    color: var(--text-light);
    max-width: 600px;
    font-weight: 500;
}

.github-link {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(3, 102, 214, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
}

.github-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(3, 102, 214, 0.4);
}

/* About Section */
.about-section {
    background: var(--bg-light);
    padding: 40px;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 20px;
}

.about-bio {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text);
    background: white;
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid var(--primary);
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 18px;
    background: white;
    border-radius: 8px;
    border-left: 5px solid var(--secondary);
    transition: var(--transition);
}

.info-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.info-item .label {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, rgba(3, 102, 214, 0.08), rgba(111, 66, 193, 0.08));
    padding: 50px 40px;
    border-radius: 15px;
    border: 2px solid rgba(3, 102, 214, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(3, 102, 214, 0.25);
    transition: var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(3, 102, 214, 0.35);
}

.stat-card:hover::before {
    top: -20%;
    right: -20%;
}

.stat-label {
    display: block;
    font-size: 0.95rem;
    opacity: 0.95;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

/* Skills Section */
.skills-section {
    background: var(--bg-light);
    padding: 40px;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.skill-tag {
    display: inline-block;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 30px;
    font-weight: 700;
    transition: var(--transition);
    cursor: default;
    box-shadow: 0 4px 12px rgba(3, 102, 214, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.skill-tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(3, 102, 214, 0.25);
}

/* Projects Section */
.projects-section {
    background: linear-gradient(135deg, rgba(3, 102, 214, 0.05), rgba(111, 66, 193, 0.05));
    padding: 40px;
    border-radius: 12px;
    border: 2px solid rgba(3, 102, 214, 0.1);
}

.projects-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    padding: 30px;
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(3, 102, 214, 0.2);
    transform: translateY(-8px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.project-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.project-name:hover {
    color: var(--secondary);
}

.project-stars {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #ffc107;
    white-space: nowrap;
    font-size: 1.1rem;
}

.project-description {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.7;
    font-weight: 500;
}

.project-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.project-language {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.language-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, var(--accent), #20c997);
    color: white;
    padding: 50px 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(40, 167, 69, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.contact-section h2 {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.contact-section p {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    font-size: 1.1rem;
}

.contact-btn {
    display: inline-block;
    padding: 16px 45px;
    background: white;
    color: var(--accent);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: var(--transition);
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.contact-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.95);
}

/* ========== CUSTOMIZATION PANEL ========== */
.customization-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    background: white;
    border-left: 3px solid var(--primary);
    border-top: 3px solid var(--primary);
    border-radius: 15px 0 0 0;
    padding: 30px 25px;
    box-shadow: -5px -5px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 380px;
    z-index: 50;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInPanel 0.4s ease-out;
}

@keyframes slideInPanel {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.customization-panel h3 {
    margin-bottom: 25px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.customization-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.customization-group:last-child {
    border-bottom: none;
}

.customization-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.theme-select:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(3, 102, 214, 0.1);
}

.theme-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(3, 102, 214, 0.15);
}

.section-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 12px;
    border-radius: 6px;
    transition: var(--transition);
    background: var(--bg-light);
    border: 2px solid transparent;
}

.toggle-label:hover {
    background: rgba(3, 102, 214, 0.08);
    border-color: var(--primary);
}

.toggle-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.toggle-label input[type="checkbox"]:checked {
    accent-color: var(--primary);
}

/* ========== LOADING & ERROR STATES ========== */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
}

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease-out;
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close:hover {
    color: var(--text);
}

.modal-content h2 {
    margin-bottom: 15px;
    border: none;
    padding: 0;
}

.modal-content p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.share-link-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.copy-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.copy-btn:hover {
    background: #0256c7;
}

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none !important;
}

/* ========== THEME VARIATIONS ========== */

/* Dark Theme */
body.theme-dark {
    --bg: #0d1117;
    --bg-light: #161b22;
    --text: #c9d1d9;
    --text-light: #8b949e;
    --border: #30363d;
}

body.theme-dark .landing-page {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

body.theme-dark .github-link,
body.theme-dark .generate-btn {
    background: #238636;
}

body.theme-dark .github-link:hover,
body.theme-dark .generate-btn:hover {
    background: #2ea043;
}

body.theme-dark .project-card {
    background: #161b22;
    border-color: #30363d;
}

body.theme-dark .stat-card {
    background: linear-gradient(135deg, #238636, #1f6feb);
}

/* Improve visibility for header/back button and customization panel in dark theme */
body.theme-dark .back-btn {
    color: var(--text);
    border-color: var(--border);
    background: transparent;
}

body.theme-dark .back-btn:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--primary);
}

body.theme-dark .customization-panel {
    background: var(--bg-light);
    color: var(--text);
    border-left-color: var(--primary);
    border-top-color: var(--primary);
    box-shadow: -5px -5px 40px rgba(0, 0, 0, 0.6);
}

body.theme-dark .customization-panel .theme-select,
body.theme-dark .customization-panel input,
body.theme-dark .customization-panel select,
body.theme-dark .customization-panel textarea {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

/* Colorful Theme */
body.theme-colorful {
    --primary: #ff006e;
    --secondary: #8338ec;
}

body.theme-colorful .landing-page {
    background: linear-gradient(135deg, #ff006e, #ffbe0b, #fb5607, #8338ec);
}

body.theme-colorful .stat-card {
    background: linear-gradient(135deg, #ff006e, #ffbe0b);
}

body.theme-colorful .stat-card:nth-child(2) {
    background: linear-gradient(135deg, #fb5607, #8338ec);
}

body.theme-colorful .stat-card:nth-child(3) {
    background: linear-gradient(135deg, #3a86ff, #8338ec);
}

/* Tech Theme */
body.theme-tech {
    --primary: #00d9ff;
    --secondary: #ff006e;
    --bg: #0a0e27;
    --bg-light: #1a1f3a;
    --text: #e0f7ff;
    --text-light: #244b57a9;
    --border: #00d9ff;
}

body.theme-tech .landing-page {
    background: linear-gradient(135deg, #0a0e27, #1a1f3a);
    color: #00d9ff;
}

body.theme-tech .skill-tag {
    background: transparent;
    border: 2px solid #00d9ff;
    color: #00d9ff;
    text-shadow: 0 0 10px #00d9ff;
}

/* Ensure consistent readable text across theme variations */
body.theme-dark .portfolio-page,
body.theme-tech .portfolio-page,
body.theme-colorful .portfolio-page,
body[class*="theme-"] .portfolio-container {
    color: var(--text);
}

body.theme-tech .back-btn,
body.theme-colorful .back-btn {
    color: var(--text);
    border-color: var(--border);
    background: transparent;
}

body.theme-tech .back-btn:hover,
body.theme-colorful .back-btn:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--primary);
}

body.theme-tech .customization-panel,
body.theme-colorful .customization-panel,
body.theme-dark .customization-panel {
    background: var(--bg-light);
    color: var(--text);
    border-left-color: var(--primary);
    border-top-color: var(--primary);
}

body.theme-tech .customization-panel .theme-select,
body.theme-colorful .customization-panel .theme-select,
body.theme-dark .customization-panel .theme-select,
body.theme-tech .customization-panel input,
body.theme-colorful .customization-panel input,
body.theme-dark .customization-panel input,
body.theme-tech .customization-panel textarea,
body.theme-colorful .customization-panel textarea,
body.theme-dark .customization-panel textarea,
body.theme-tech .customization-panel select,
body.theme-colorful .customization-panel select,
body.theme-dark .customization-panel select {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

/* Make section headings and card labels readable in all themes */
body[class*="theme-"] .section h2,
body[class*="theme-"] .info-item .label,
body[class*="theme-"] .about-bio,
body[class*="theme-"] .hero-section h1 {
    color: var(--text);
}

/* Ensure buttons inside portfolio header are visible */
body[class*="theme-"] .portfolio-header .back-btn,
body[class*="theme-"] .portfolio-header button {
    color: var(--text);
    border-color: var(--border);
}


body.theme-tech .skill-tag:hover {
    background: rgba(0, 217, 255, 0.1);
    box-shadow: 0 0 20px #00d9ff;
}

/* ========== ANIMATIONS ========== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .landing-content h1 {
        font-size: 2.2rem;
    }

    .landing-content p {
        font-size: 1.05rem;
    }

    .input-group {
        flex-direction: column;
    }

    .portfolio-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .portfolio-controls {
        width: 100%;
        justify-content: space-between;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section h2 {
        font-size: 1.6rem;
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }

    .avatar {
        width: 140px;
        height: 140px;
    }

    .customization-panel {
        position: static;
        max-width: none;
        margin: 0;
        margin-top: 40px;
        width: 100%;
        border-radius: 15px;
        border-left: 3px solid var(--primary);
        border-top: 3px solid var(--primary);
    }

    .template-options {
        flex-direction: column;
        align-items: stretch;
    }

    .template-option {
        justify-content: center;
    }

    .project-header {
        flex-direction: column;
    }

    .project-stars {
        justify-self: start;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .hero-section {
        padding: 40px 25px;
    }

    .stats-section,
    .about-section,
    .skills-section,
    .projects-section {
        padding: 30px 20px;
    }

    .contact-section {
        padding: 40px 25px;
    }
}

@media (max-width: 480px) {
    .landing-content h1 {
        font-size: 1.8rem;
    }

    .portfolio-container {
        padding: 20px 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section {
        margin-bottom: 30px;
    }

    .error-message {
        max-width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
}
