/* CSS Variables & Theme */
:root {
    /* Colors */
    /* Colors */
    --color-primary: #2C3E50;
    /* Deep Charcoal */
    --color-primary-light: #34495E;
    --color-secondary: #18BC9C;
    /* Emerald Teal */
    --color-secondary-hover: #128F76;

    --color-bg-white: #FFFFFF;
    --color-bg-light: #eaeff2;

    --color-surface: #FFFFFF;
    /* cards / panels / bright middle */

    /* Cool light gray */
    --color-bg-dark: #1A252F;

    --color-text-main: #2C3E50;
    --color-text-light: #586776;
    --color-text-white: #FFFFFF;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Transitions */
    --transition-standard: all 0.3s ease;

    /* “On color” text (used on top of backgrounds) */
    --color-on-primary: #FFFFFF;
    --color-on-secondary: #2C3E50;
    --color-on-bg: #2C3E50;
    --color-on-surface: #2C3E50;

    /* Section-specific */
    --color-experience-bg: var(--color-bg-light);



}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-on-bg);
    background-color: var(--color-bg-white);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-standard);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Classes */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.section {
    padding: var(--spacing-xl) 0;
}

.bg-light {
    background-color: var(--color-bg-light);
}

/* Override specifically for Professional Experience section */
#experience {
    background-color: var(--color-experience-bg) !important;
    color: var(--color-on-bg);
}

.bg-dark {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

.hidden {
    display: none !important;

}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    background-color: var(--color-primary);
    color: var(--color-text-white);
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

.btn-gold {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    color: var(--color-primary);
}

.btn-gold:hover {
    background-color: var(--color-secondary-hover);
    color: var(--color-primary);
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-links a:not(.btn) {
    font-weight: 500;
    color: var(--color-text-main);
    position: relative;
}

.nav-links a:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-secondary);
    transition: width 0.3s;
}

.nav-links a:not(.btn):hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

/* Hero Section - UPDATED LAYOUT */
.hero {
    padding-top: 140px;
    padding-bottom: 100px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    /* Dark Professional Background */
    background-color: var(--color-primary);
    background: linear-gradient(135deg, #2C3E50 0%, #1A252F 100%);
    overflow: hidden;
    color: white;
    /* Default text color for hero */
}

/* Subtle pattern overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(24, 188, 156, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 4rem;
    position: relative;
    /* Ensure content is above background pattern */
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    color: #FFFFFF;
    /* Explicit white for dark bg */
}

.hero h2 {
    font-size: 2rem;
    color: #B8E6D5;
    /* Light teal for visibility */
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--color-secondary);
    font-style: italic;
}

.hero p {
    font-size: 1.25rem;
    color: #E1E8ED;
    /* Lighter text for description */
    margin-bottom: var(--spacing-md);
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.hero-actions .btn-outline {
    color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.hero-actions .btn-outline:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
}

.hero-image {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
}

.profile-photo-placeholder {
    width: 350px;
    height: 350px;
    background-color: #2C3E50;
    /* Darker placeholder bg */
    border-radius: 50%;
    overflow: hidden;
    border: 8px solid rgba(255, 255, 255, 0.1);
    /* Subtle border */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.profile-photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* About Section */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.line {
    width: 60px;
    height: 4px;
    background-color: var(--color-secondary);
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.about-text h3 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--color-text-light);
}

.education-block {
    margin-top: 2rem;
    padding: 2rem;
    background-color: var(--color-bg-white);
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.education-block h4 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.university {
    color: var(--color-secondary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.achievements li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.achievements li::before {
    content: '•';
    color: var(--color-secondary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.skills-card {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    padding: 2.5rem;
    border-radius: 8px;
}

.skills-card h3 {
    color: var(--color-text-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.skill-group {
    margin-bottom: 2rem;
}

.skill-group h4 {
    color: var(--color-secondary);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Experience Section */
.experience-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Horizontal Project Carousel */
.projects-carousel {
    display: flex;
    flex-wrap: nowrap;
    /* Force entries to stay on one line */
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-secondary) transparent;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-primary);
    cursor: pointer;
    transition: var(--transition-standard);
}

.carousel-dots .dot.active {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    transform: scale(1.2);
}

.projects-carousel::-webkit-scrollbar {
    height: 8px;
    /* Slightly thicker for visibility */
}

.projects-carousel::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 10px;
}

.projects-carousel .experience-card {
    flex: 0 0 85%;
    /* Don't grow, don't shrink, take 85% width */
    min-width: 300px;
    scroll-snap-align: start;
}

@media (min-width: 992px) {
    .projects-carousel .experience-card {
        flex: 0 0 calc(50% - 1rem);
        /* Show 2 cards on desktops */
    }
}

.experience-card {
    background-color: var(--color-surface);
    border: 1px solid #E1E8ED;
    border-radius: 8px;
    padding: 2.5rem;
    transition: var(--transition-standard);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);

    /* NEW */
    color: var(--color-on-surface);
}

/* Make "Cards Text" picker actually affect text inside cards */
.experience-card .exp-body,
.experience-card .exp-meta,
.experience-card .tech-stack span {
    color: var(--color-on-surface);
}

.experience-card:hover {
    box-shadow: 0 10px 30px rgba(10, 35, 66, 0.08);
    border-color: var(--color-secondary);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    /* Increased gap for clarity */
}

/* Ensure the title section can grow but leave space for meta */
.exp-header>div:first-child {
    flex: 1;
    min-width: 250px;
}

.exp-header h3 {
    margin-bottom: 0.2rem;
    font-size: 1.4rem;
}

.exp-header .company {
    font-family: var(--font-body);
    color: var(--color-secondary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0;
}

.exp-meta {
    text-align: right;
    color: #8899A6;
    font-size: 0.9rem;
    line-height: 1.4;
    flex-shrink: 0;
    /* Don't allow meta to squish and wrap */
}

.exp-body {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.exp-body p {
    margin-bottom: 1rem;
}

.exp-body ul {
    list-style: disc;
    padding-left: 1.2rem;
}

.exp-body li {
    margin-bottom: 0.5rem;
}

.tech-stack span {
    display: inline-block;
    background-color: var(--color-bg-light);
    border: 1px solid #E1E8ED;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--color-text-main);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Contact Section */
.contact-container {
    text-align: center;
    color: var(--color-text-white);
}

.contact-header h2 {
    color: var(--color-text-white);
}

.contact-header p {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-white);
    opacity: 0.8;
    transition: opacity 0.2s;
}

.social-link:hover {
    opacity: 1;
    color: var(--color-secondary);
}

/* Footer */
footer {
    padding: 2rem 0;
    background-color: var(--color-bg-dark);
    color: #6B7C93;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* EDIT MODE STYLES */
[contenteditable="true"] {
    outline: 2px dashed rgba(24, 188, 156, 0.5);
    /* Muted Gold dashed line */
    outline-offset: 4px;
    cursor: text;
    border-radius: 2px;
}

[contenteditable="true"]:focus {
    outline: 2px solid var(--color-secondary);
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-primary);
    color: white;
    padding: 1rem 0;
    z-index: 2000;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

.admin-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Delete Card Button */
.delete-card-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background-color: white;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    opacity: 0;
    /* Hidden by default */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.experience-card:hover .delete-card-btn {
    opacity: 1;
}

.delete-card-btn:hover {
    background-color: #e74c3c;
    color: white;
    transform: scale(1.1) rotate(90deg);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* simple hide for mobile, would need JS for toggle */
    }

    .menu-toggle {
        display: block;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-image {
        justify-content: center;
        order: -1;
        /* Image on top for mobile */
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-actions {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .exp-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .exp-meta {
        text-align: left;
    }

    .contact-actions {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* AUTH MODAL STYLES */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.auth-box {
    background-color: white;
    padding: 2.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #8899A6;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #E1E8ED;
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.3s;
}

.form-group input:focus {
    border-color: var(--color-secondary);
    outline: none;
}

.auth-toggle-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--color-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.auth-toggle-link:hover {
    text-decoration: underline;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    font-size: 0.9rem;
    color: var(--color-primary);
    background: rgba(24, 188, 156, 0.1);

    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

/* READ ONLY MODE */
body.read-only [data-editable],
body.read-only [data-editable-image],
body.read-only [data-editable-link],
body.read-only [data-editable-pdf] {
    pointer-events: none !important;
    cursor: default !important;
}

/* ✅ Allow links to be clickable in read-only mode (email, LinkedIn, etc.) */
body.read-only a[data-editable-link] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

body.read-only .btn-gold,
body.read-only .btn-outline {
    /* Optional: Hide buttons in read-only mode if they are for editing */
}

/* Hide Add Buttons explicitly in read-only */
body.read-only #add-experience-btn,
body.read-only #add-project-btn,
body.read-only #add-award-btn,
body.read-only .delete-card-btn {
    display: none !important;
}

/* EDITOR TOOLBAR */
.editor-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.5rem 1rem;
    align-items: center;
    border-bottom: 1px solid #eee;
}

body.edit-active {
    margin-top: 60px;
    /* Push body down */
}

.toolbar-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-right: 1px solid #eee;
    padding-right: 1rem;
}

.toolbar-group:last-child {
    border-right: none;
}

.editor-toolbar button {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    font-size: 1rem;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.editor-toolbar button:hover {
    background-color: var(--color-bg-light);
    border-color: #ddd;
}

.editor-toolbar select,
.editor-toolbar input[type="color"] {
    padding: 0.3rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* EDITOR SIDEBAR */
.editor-sidebar {
    position: fixed;
    top: 60px;
    /* Below Toolbar */
    left: 0;
    width: 200px;
    height: calc(100% - 60px);
    background-color: white;
    border-right: 1px solid #eee;
    padding: 1rem;
    z-index: 1900;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

body.sidebar-active .editor-sidebar {
    transform: translateX(0);
}

body.sidebar-active {
    margin-left: 200px;
    width: calc(100% - 200px);
}

.editor-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #8899A6;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.block-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background-color: white;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all 0.2s;
}

.block-item:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.block-item:active {
    cursor: grabbing;
}

/* SUCCESS MODAL EXTRAS */
.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.share-link-container input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.modal-actions {
    margin-top: 1rem;
    text-align: center;
}

/* WATERMARK */
#careercraftr-watermark {
    text-align: center;
    padding: 1rem;
    background: #2C3E50;
    color: white;
    font-size: 0.8rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 9999;
}



/* ========================================= */
/* HARD ADMIN LOCK (prevents Save-As leak) */
/* ========================================= */

/* Hide all admin-only UI by default */
[data-admin-only="true"] {
    display: none !important;
}

/* Only show admin UI when edit mode is active */
body.edit-active [data-admin-only="true"] {
    display: inline-flex !important;
}

/* If it's a container (like admin bar) */
body.edit-active div[data-admin-only="true"] {
    display: block !important;
}


/* =========================
   Theme Panel (Admin Mode)
   ========================= */
.admin-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.theme-panel {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
}

.theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.4rem 0;
}

.theme-row label {
    color: white;
    font-size: 0.9rem;
    opacity: 0.95;
}

.theme-row input[type="color"] {
    width: 44px;
    height: 30px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.theme-buttons {
    justify-content: flex-end;
}

/* =========================================
   FORCE Cards Text to apply inside cards
   (must be after the original exp-meta/exp-body/tech-stack rules)
   ========================================= */
.experience-card .exp-meta,
.experience-card .exp-body,
.experience-card .exp-body *,
.experience-card .tech-stack span {
    color: var(--color-on-surface) !important;
}