/* Modern Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --secondary: #7c3aed;
    --accent: #10b981;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #94a3b8;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background-color: var(--light);
    color: var(--dark);
    margin: 0 auto;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navigation */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    align-items: center;
    position: relative;
}

#nav-links {
    list-style: none;
    display: flex; /* Always flex for desktop display */
    gap: 1.5rem;
}

#nav-links li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

#nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: var(--transition);
}

#nav-links li a:hover::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none; /* Hidden by default on larger screens */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    padding: 0;
    background: transparent;
    border: none;
    z-index: 1001;
}

.hamburger span {
    height: 3px;
    width: 100%;
    background: white;
    margin-bottom: 5px;
    border-radius: 5px;
    transition: var(--transition);
    display: block;
}

.hamburger span:last-child {
    margin-bottom: 0;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Main Content */
main {
    padding: 2rem 0;
}

section {
    background: white;
    margin-bottom: 2rem;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* About Section */
.about-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

#profile-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
    outline: 2px solid var(--accent);
    flex-shrink: 0;
}

/* Experience & Education Items */
.experience-item, .education-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    position: relative;
}

.experience-item:last-child,
.education-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.experience-item h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.company, .institution {
    font-weight: 600;
    color: var(--dark);
}

.duration, .year {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Skills & Languages */
#skills-list, #languages-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    list-style: none;
}

#skills-list li, #languages-list li {
    background: var(--light);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

#skills-list li:hover, #languages-list li:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* References */
.reference-item {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.reference-item p {
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;   
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-icons a i {
    display: inline-block;
}

/* Social Media Specific Colors (UPDATED for non-conflicting names) */
.social-icons a.bg-facebook { background: #3b5998; }
.social-icons a.bg-twitter { background: #1da1f2; }
.social-icons a.bg-linkedin { background: #0077b5; }
.social-icons a.bg-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.social-icons a.bg-github { background: #333; }
.social-icons a.bg-envelope { background: #EA4335; }


.social-icons a:hover {
    transform: translateY(-3px) scale(1.1);
}

/* File Select Button */
.file-select-btn {
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.file-select-btn:hover {
    background: #0ea472;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.file-select-btn i {
    font-size: 1rem;
}

/* --- Form Specific Styles --- */
.form-section {
    background: white;
    margin-bottom: 2rem;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    color: var(--dark);
    background-color: var(--light);
    transition: border-color var(--transition);
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); /* primary with opacity */
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.dynamic-list-item {
    background-color: var(--light);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.dynamic-list-item .form-group {
    margin-bottom: 0; /* Reset margin for nested form groups */
}

.dynamic-list-item .item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-item-btn, .remove-item-btn, .form-action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.add-item-btn {
    background: var(--primary);
    color: white;
}

.add-item-btn:hover {
    background: #1d4ed8; /* Darker primary */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.remove-item-btn {
    background: #ef4444; /* Red for delete */
    color: white;
}

.remove-item-btn:hover {
    background: #dc2626; /* Darker red */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.form-action-btn {
    background: var(--accent);
    color: white;
    margin-top: 2rem;
    margin-right: 1rem;
}

.form-action-btn:hover {
    background: #0ea472;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.back-btn {
    background: var(--gray);
    color: white;
    margin-top: 2rem;
}

.back-btn:hover {
    background: #6b7280; /* Darker gray */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Responsive Styles */
@media (min-width: 769px) {
    #nav-links {
        display: flex !important;
        transform: translateY(0) !important;
    }
    .hamburger {
        display: none !important;
    }
    .file-select-btn {
        margin-right: 1rem;
    }
    .header-content {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .header-content {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    .header-content h1 {
        order: 1;
        flex-grow: 1;
        text-align: left;
    }

    nav {
        order: 2;
    }

    .file-select-btn {
        order: 3;
        margin-right: 0;
        width: 100%;
        justify-content: center;
    }

    .hamburger {
        display: flex;
    }

    #nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        padding: 80px 1.5rem 1.5rem;
        box-shadow: var(--shadow-md);
        z-index: 998;
        transform: translateX(100%);
        transition: transform 0.3s ease-out;
        overflow-y: auto;
    }

    #nav-links.active {
        display: flex;
        transform: translateX(0);
        gap: 0;
        height: auto;
    }

    #nav-links li {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin: 0;
        text-align: center;
    }

    #nav-links li:last-child {
        border-bottom: none;
    }

    .about-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #profile-photo {
        width: 120px;
        height: 120px;
        margin-bottom: 1.5rem;
    }

    section {
        padding: 1.5rem;
    }

    .social-icons {
        flex-wrap: wrap;
    }

    /* Form specific responsive adjustments */
    .dynamic-list-item {
        padding: 1rem;
        gap: 0.75rem;
    }
    .add-item-btn, .remove-item-btn, .form-action-btn, .back-btn {
        width: 100%;
        justify-content: center;
        margin-right: 0; /* Remove margin for full width */
    }
    .form-action-btn, .back-btn {
        margin-top: 1rem; /* Adjust top margin for stacked buttons */
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

section {
    animation: fadeIn 0.5s ease-out forwards;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }


.action-link {
    color: #FF5733; /* A bright orange/red for visibility */
    text-decoration: none; /* Removes the underline */
    font-weight: bold; /* Makes the text bolder */
}

.action-link:hover {
    color: #C70039; /* Darker shade on hover for interaction feedback */
    text-decoration: underline; /* Add underline back on hover */
}