:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --bg-color: #ffffff;
    --section-bg: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --header-bg: #ffffff;
}

[data-theme="dark"] {
    --primary-color: #ecf0f1;
    --secondary-color: #3498db;
    --text-color: #ecf0f1;
    --bg-color: #1a1a1a;
    --section-bg: #2c2c2c;
    --border-color: #444;
    --shadow: 0 2px 4px rgba(255,255,255,0.1);
    --header-bg: #2c2c2c;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-content input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
}

.modal-content button {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-content button:hover {
    background: #2980b9;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Control Panel */
.control-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    padding: 1rem;
    box-shadow: var(--shadow);
    z-index: 100;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.control-panel button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.control-panel button:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Resume Container */
.resume-container {
    max-width: 900px;
    margin: 5rem auto 2rem;
    background: var(--bg-color);
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Header Section */
.resume-header {
    background: var(--header-bg);
    padding: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.profile-section {
    text-align: center;
}

.profile-info h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.profile-info h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.profile-info p {
    color: var(--text-color);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* Resume Body */
.resume-body {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0;
}

.left-column {
    background: var(--section-bg);
    padding: 2rem;
    border-right: 1px solid var(--border-color);
}

.right-column {
    padding: 2rem;
}

/* Section Styles */
.resume-section {
    margin-bottom: 2rem;
}

.resume-section h3 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Contact Info */
.contact-info p {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Skills */
.skill-category {
    margin-bottom: 1rem;
}

.skill-category strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
}

/* Projects */
.project-item {
    margin-bottom: 0.75rem;
}

.project-item strong {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Experience */
.experience-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.experience-item:last-child {
    border-bottom: none;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.experience-header h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.date {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.experience-details {
    margin-top: 1rem;
}

.experience-details p {
    font-weight: bold;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
}

.experience-details ul {
    list-style-position: inside;
    margin-left: 1rem;
}

.experience-details li {
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

/* Education */
.education-item {
    margin-bottom: 1rem;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
}

/* Editable Styles */
.editable {
    transition: background-color 0.3s;
    border-radius: 4px;
    position: relative;
}

.editable.edit-mode {
    background-color: rgba(52, 152, 219, 0.1);
    padding: 4px;
    border: 1px dashed var(--secondary-color);
    cursor: text;
    min-height: 1.5em;
}

.editable.edit-mode:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.editable.edit-mode:focus {
    outline: 2px solid var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.15);
}

.editable-list.edit-mode {
    background-color: rgba(52, 152, 219, 0.1);
    padding: 8px;
    border: 1px dashed var(--secondary-color);
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-panel {
        padding: 0.75rem;
    }
    
    .control-panel button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .resume-container {
        margin: 4rem 1rem 1rem;
        border-radius: 0;
    }
    
    .profile-info h1 {
        font-size: 2rem;
    }
    
    .profile-info h2 {
        font-size: 1.2rem;
    }
    
    .resume-body {
        grid-template-columns: 1fr;
    }
    
    .left-column {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
    }
    
    .experience-header {
        flex-direction: column;
    }
    
    .education-header {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .resume-header {
        padding: 1.5rem;
    }
    
    .left-column,
    .right-column {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .control-panel {
        display: none;
    }
    
    .resume-container {
        margin: 0;
        box-shadow: none;
    }
    
    .editable.edit-mode {
        border: none;
        background: none;
        padding: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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