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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    cursor: crosshair;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('pictures/bg.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    transition: opacity 0.8s ease-in-out;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.header-section {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
    padding: 60px 20px;
    text-align: center;
    border-bottom: 3px solid #00ff88;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
}

header h1 {
    font-size: 2.5em;
    color: #00ff88;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 255, 136, 0.5);
}

header p {
    font-size: 1.2em;
    color: #b0b0b0;
}

.content-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

section {
    background: #0b1915;
    padding: 40px;
    margin-bottom: 40px;
    border-radius: 0;
    border: 3px solid #44ff9f;
    box-shadow:
        inset 0 0 0 3px #041811,
        inset 0 0 40px rgba(2, 32, 22, 0.6),
        0 8px 26px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

section::before,
section::after {
    content: '';
    display: none;
}

section::before {
    inset: -2px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.35), rgba(34, 211, 238, 0.15));
}

section::after {
    width: 220px;
    height: 220px;
    top: -80px;
    right: -80px;
    background: radial-gradient(circle at center, rgba(0, 255, 136, 0.45), transparent 70%);
    opacity: 0.25;
}

section:nth-of-type(2n-1),
section:nth-of-type(2n),
section:nth-of-type(3n) {
    background: #0b1915;
    border-color: #44ff9f;
    box-shadow:
        inset 0 0 0 3px #041811,
        inset 0 0 40px rgba(2, 32, 22, 0.6),
        0 8px 26px rgba(0, 0, 0, 0.4);
}

section h2 {
    color: #00ff88;
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: none;
    padding-bottom: 0;
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    margin-top: 14px;
    width: 96px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, #00ff88 0%, #22d3ee 100%);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

section p {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #d0d0d0;
}

.hobbies-and-games img {
    max-width: 200px;
    width: 200px;
    height: 200px;
    object-fit: contain;
}

a {
    color: #22d3ee;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

a:hover {
    color: #00ff88;
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

section img {
    max-width: 150px;
    height: auto;
    margin: 15px 10px;
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 136, 0.4);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

section img:hover {
    transform: scale(1.1);
    border-color: #00ff88;
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
}

.information img {
    max-width: 120px;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
}

#hackatime-stats img {
    max-width: 100%;
    border-radius: 10px;
    margin: 20px 0;
}

.hobbies-and-games img {
    max-width: 200px;
}

.guestbook-description {
    margin-bottom: 16px;
    color: #b0b0b0;
}

.guestbook-form {
    display: grid;
    gap: 16px;
    margin-bottom: 12px;
}

.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 0.95rem 1.2rem;
    font: inherit;
    color: #f7fbff;
    /* Layered backgrounds keep the fill subtle while painting a separate accent border */
    background:
        linear-gradient(135deg, rgba(16, 20, 45, 0.88), rgba(32, 55, 92, 0.88)) padding-box,
        linear-gradient(120deg, rgba(0, 255, 136, 0.45), rgba(34, 211, 238, 0.55)) border-box;
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 25px rgba(12, 18, 40, 0.35);
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.guestbook-form input::placeholder,
.guestbook-form textarea::placeholder {
    color: rgba(247, 251, 255, 0.6);
    letter-spacing: 0.02em;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
    outline: none;
    background:
        linear-gradient(135deg, rgba(17, 27, 52, 0.95), rgba(36, 70, 118, 0.95)) padding-box,
        linear-gradient(110deg, rgba(176, 255, 252, 0.95), rgba(34, 211, 238, 0.85), rgba(0, 255, 136, 0.9)) border-box;
    box-shadow: 0 0 0 3px rgba(176, 255, 252, 0.25), 0 15px 30px rgba(18, 32, 70, 0.55);
    transform: translateY(-2px);
}

.guestbook-form textarea {
    min-height: 150px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88 0%, #22d3ee 100%);
    color: #0a0a0a;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 255, 136, 0.45);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.6);
    color: #22d3ee;
    border: 1px solid rgba(34, 211, 238, 0.4);
    box-shadow: none;
}

.btn-secondary:hover {
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.6);
    transform: translateY(-2px);
}

.guestbook-submit {
    align-self: flex-start;
}

.guestbook-feedback {
    min-height: 20px;
    font-size: 0.95em;
    color: #00ff88;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guestbook-feedback.visible {
    opacity: 1;
}

.guestbook-feedback--error {
    color: #f87171;
}

.guestbook-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.guestbook-list {
    list-style: none;
    display: grid;
    gap: 16px;
    margin-top: 12px;
}

.guestbook-entry {
    padding: 18px;
    border-radius: 0;
    border: 2px solid #39f28e;
    background: #09130f;
    box-shadow:
        inset 0 0 0 2px #03110c,
        inset 0 0 30px rgba(3, 32, 20, 0.6),
        0 6px 18px rgba(0, 0, 0, 0.45);
}

.guestbook-entry__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 12px;
}

.guestbook-entry__author {
    font-weight: 600;
    color: #00ff88;
}

.guestbook-entry__time {
    font-size: 0.85em;
    color: #9ca3af;
}

.guestbook-entry__message {
    color: #d0d0d0;
}

.guestbook-empty {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
    border-radius: 0;
    background: rgba(9, 19, 15, 0.75);
    border: 2px solid #39f28e;
    box-shadow:
        inset 0 0 0 2px #03110c,
        inset 0 0 30px rgba(3, 32, 20, 0.4),
        0 6px 18px rgba(0, 0, 0, 0.35);
}

.guestbook-more {
    font-size: 0.9em;
    color: #94a3b8;
    text-align: right;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    header p {
        font-size: 1em;
    }

    section {
        padding: 25px;
    }

    section h2 {
        font-size: 1.5em;
    }

    section img {
        max-width: 100px;
    }

    .hobbies-and-games img {
        max-width: 150px;
    }

    section::after {
        width: 150px;
        height: 150px;
        top: -60px;
        right: -60px;
    }

    section:nth-of-type(2n)::after {
        bottom: -60px;
        left: -60px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    section {
        padding: 20px;
    }

    section img {
        max-width: 80px;
        margin: 10px 5px;
    }
}

html {
    scroll-behavior: smooth;
}

::selection {
    background-color: #00ff88;
    color: #000;
}

footer {
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
    color: #b0b0b0;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 3px solid #00ff88;
    box-shadow: 0 -4px 20px rgba(0, 255, 136, 0.4);
    font-size: 1.1em;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00ff88, transparent);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.loading-content img {
    max-width: 250px;
    max-height: 250px;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.5));
    animation: pulse 1s ease-in-out;
}

.loading-content p {
    font-size: 1.5em;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.7);
    animation: fadeIn 0.5s ease-in;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }
.fade-in:nth-child(3) { transition-delay: 0.3s; }
.fade-in:nth-child(4) { transition-delay: 0.4s; }
.fade-in:nth-child(5) { transition-delay: 0.5s; }
.fade-in:nth-child(6) { transition-delay: 0.6s; }

body.loading .header-section,
body.loading .content-section {
    opacity: 0;
}

body.loaded .header-section,
body.loaded .content-section {
    animation: fadeInUp 0.8s ease-out forwards;
}

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

@media (max-width: 600px) {
    .guestbook-actions {
        justify-content: center;
    }
}
