/* =========================================
   Apple Liquid Glassmorphism Style
   ========================================= */

:root {
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --text-main: #1d1d1f; /* Apple Dark Gray */
    --text-muted: #515154;
    --accent: #007aff; /* Apple Blue */
}

/* Dark Mode Preference (optional, you could toggle this via JS later) */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(30, 30, 30, 0.4);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
        --text-main: #f5f5f7;
        --text-muted: #a1a1a6;
        --accent: #0a84ff;
    }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    background-color: #e5e5ea;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Dynamic Colorful Background (Big Sur Vibe) */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #f2f2f7;
}

@media (prefers-color-scheme: dark) {
    .background-orbs { background: #000; }
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.8;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: #ff2d55; /* Apple Pink/Red */
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #5856d6; /* Apple Purple */
    bottom: -100px;
    right: -50px;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: #34c759; /* Apple Green */
    top: 30%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.1); }
}



/* Container */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-main);
}

/* Hero Section */
.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.1));
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

#profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#profile-name {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

#profile-title {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--accent);
    margin-bottom: 16px;
}

#profile-bio {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    position: relative;
    padding: 10px 10px 10px 45px;
    border-radius: 12px;
}

.timeline-item:hover {
    background: rgba(0,0,0,0.03);
}

@media (prefers-color-scheme: dark) {
    .timeline-item:hover {
        background: rgba(255,255,255,0.05);
    }
}

.timeline-dot {
    position: absolute;
    left: 8px;
    top: 14px;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-dot.completed {
    background: #34c759; /* Green */
    box-shadow: 0 0 10px #34c759;
}
.timeline-dot.completed i {
    color: white;
    font-size: 8px;
}

.timeline-dot svg {
    width: 20px;
    height: 20px;
}

.timeline-year {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-location {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.read-more-btn:hover {
    opacity: 0.7;
}

.timeline-desc {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    margin-top: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.timeline-item.expanded .timeline-desc {
    max-height: 500px;
    opacity: 1;
    margin-top: 12px;
}

/* Skills */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
}

.skill-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .skill-bar-bg { background: rgba(255,255,255,0.1); }
}

.skill-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    width: 0; /* Animated via JS */
    transition: width 1s cubic-bezier(0.1, 0.8, 0.2, 1);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Scrollbar für Projects */
.projects-grid::-webkit-scrollbar {
    width: 8px;
}
.projects-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}
.projects-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
.projects-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.project-item {
    background: rgba(255,255,255,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-item h4 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.project-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-grow: 1;
}

.project-status {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-erledigt { background: rgba(52, 199, 89, 0.2); color: #34c759; border: 1px solid #34c759; }
.status-in-bearbeitung { background: rgba(0, 122, 255, 0.2); color: #007aff; border: 1px solid #007aff; }
.status-abgebrochen { background: rgba(255, 59, 48, 0.2); color: #ff3b30; border: 1px solid #ff3b30; }

@media (prefers-color-scheme: dark) {
    .project-item { background: rgba(0,0,0,0.2); }
}

/* Hobbies */
.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.hobby-item {
    background: rgba(255,255,255,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    .hobby-item { background: rgba(0,0,0,0.2); }
}

.hobby-item:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

.hobby-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    color: var(--text-main);
}

.hobby-item:hover .hobby-icon {
    color: white;
}

.hobby-icon svg {
    width: 32px;
    height: 32px;
}

.hobby-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Contact */
.contact-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.contact-btn {
    padding: 12px 24px;
    border-radius: 100px;
    text-decoration: none;
    color: var(--text-main);
    background: rgba(255,255,255,0.3);
    border: 1px solid var(--glass-border);
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (prefers-color-scheme: dark) {
    .contact-btn { background: rgba(0,0,0,0.3); }
}

.contact-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    padding: 40px;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px; height: 32px;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex; align-items: center; justify-content: center;
}

@media (prefers-color-scheme: dark) {
    .modal-close { background: rgba(0, 0, 0, 0.2); }
    .modal-close:hover { background: rgba(0, 0, 0, 0.5); }
}

.modal-close:hover { background: rgba(255, 255, 255, 0.5); }

.modal-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

/* Intro Animation */
.glass-panel {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

header.glass-panel { animation-delay: 0.1s; }
.container > section.glass-panel:nth-of-type(1) { animation-delay: 0.2s; }
.container > section.glass-panel:nth-of-type(2) { animation-delay: 0.3s; }
.grid-2 > section.glass-panel:nth-of-type(1) { animation-delay: 0.4s; }
.grid-2 > section.glass-panel:nth-of-type(2) { animation-delay: 0.5s; }
.container > section.glass-panel:nth-of-type(3) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Edit Mode Styles */
.edit-toolbar {
    position: sticky;
    top: 20px;
    z-index: 2000;
    margin: 0 auto 40px auto;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
}

[contenteditable="true"] {
    outline: 2px dashed transparent;
    border-radius: 4px;
    padding: 2px 4px;
    transition: all 0.2s;
}

[contenteditable="true"]:hover {
    outline: 2px dashed rgba(255, 255, 255, 0.2);
}

[contenteditable="true"]:focus {
    outline: 2px solid var(--accent);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

@media (prefers-color-scheme: dark) {
    [contenteditable="true"]:hover {
        outline: 2px dashed rgba(255, 255, 255, 0.3);
    }
    [contenteditable="true"]:focus {
        background: rgba(0, 0, 0, 0.3);
        color: white;
    }
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.timeline-item:hover .edit-actions,
.project-item:hover .edit-actions,
.hobby-item:hover .edit-actions {
    opacity: 1;
}

.edit-btn-small {
    background: rgba(255,0,0,0.1);
    color: #ff3b30;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.edit-btn-add {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.2s;
    opacity: 0.6;
}

.edit-btn-add:hover {
    background: rgba(255,255,255,0.2);
    opacity: 1;
}

/* Floating Save Button */
.save-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    height: 50px;
    padding: 0 20px;
    background: var(--accent);
    backdrop-filter: blur(20px);
    border: none;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 2000;
    font-weight: 600;
    cursor: pointer;
}

.save-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.6);
}


