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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    transition: background-color 0.6s cubic-bezier(0.4, 0.0, 0.2, 1),
                color 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: background-color, color;
}

body.inverted {
    background-color: #ffffff;
    color: #000000;
}

/* Container */
.container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    gap: 80px;
    align-items: flex-start;
}

/* Left Section */
.left-section {
    flex: 1;
    max-width: 500px;
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -2px;
}

.subheadline {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
    opacity: 0.9;
}

/* Input Section */
#input-section,
#retry-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.privacy-notice {
    font-size: 0.85rem;
    opacity: 0.6;
    text-align: center;
    margin-top: -8px;
}

textarea {
    width: 100%;
    padding: 20px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #2a2a2a;
    background-color: #1a1a1a;
    color: #ffffff;
    resize: vertical;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

textarea:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}

body.inverted textarea {
    border: 2px solid #e5e5e5;
    background-color: #ffffff;
    color: #000000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.inverted textarea:focus {
    border-color: #000000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

textarea::placeholder {
    color: #666666;
}

body.inverted textarea::placeholder {
    color: #999999;
}

/* Buttons */
.primary-btn {
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 500;
    background-color: #ffffff;
    color: #000000;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
    will-change: transform;
}

.primary-btn:hover {
    background-color: #e5e5e5;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.primary-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

body.inverted .primary-btn {
    background-color: #000000;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.inverted .primary-btn:hover {
    background-color: #333333;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

body.inverted .primary-btn:active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Right Section - Statue */
.right-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.statue-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.statue {
    position: relative;
}

.statue-img {
    max-width: 700px;
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
    will-change: opacity;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.statue-white {
    display: block;
}

.statue-black {
    display: none;
}

body.inverted .statue-white {
    display: none;
}

body.inverted .statue-black {
    display: block;
}

/* Loading Icon */
.loading {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #2a2a2a;
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

body.inverted .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Response Text */
.response {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.6;
    max-width: 350px;
    padding: 20px 28px;
    background-color: rgba(26, 26, 26, 0.75);
    border-radius: 16px;
    border-left: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    color: #ffffff;
    backdrop-filter: blur(10px);
    will-change: opacity;
}

body.inverted .response {
    background-color: rgba(250, 250, 250, 0.75);
    border-left: 3px solid rgba(0, 0, 0, 0.7);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    color: #000000;
}

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

/* Share Button */
.share-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 28px;
    font-size: 0.9rem;
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #2a2a2a;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    border-radius: 50px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.share-btn:hover {
    background-color: #ffffff;
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

body.inverted .share-btn {
    background-color: #ffffff;
    color: #000000;
    border: 2px solid #e5e5e5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.inverted .share-btn:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    color: #000000;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.25);
    animation: slideUp 0.3s ease;
}

body.inverted .toast {
    background-color: #000000;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 968px) {
    .container {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }

    h1 {
        font-size: 2.2rem;
        text-align: center;
    }

    .subheadline {
        font-size: 1.1rem;
        text-align: center;
    }

    .left-section {
        max-width: 100%;
        order: 2;
    }

    .right-section {
        order: 1;
    }

    .statue-img {
        max-width: 500px;
    }

    .response {
        font-size: 1rem;
        max-width: 300px;
        padding: 18px 24px;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        padding: 16px;
        align-items: flex-start;
    }

    .container {
        gap: 24px;
        min-height: 100vh;
        justify-content: space-between;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 8px;
    }

    .subheadline {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .left-section {
        width: 100%;
        position: sticky;
        bottom: 0;
        background: linear-gradient(to top, #0a0a0a 85%, transparent);
        padding: 20px 0;
        z-index: 10;
    }

    body.inverted .left-section {
        background: linear-gradient(to top, #ffffff 85%, transparent);
    }

    .right-section {
        flex: 0 0 auto;
        width: 100%;
    }

    .statue-container {
        gap: 0;
        min-height: 500px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .statue {
        position: relative;
        min-height: 350px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .statue-img {
        max-width: 100%;
        width: 100%;
    }

    /* Response below statue on mobile */
    .response {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        font-size: 1rem;
        max-width: 100%;
        width: 100%;
        padding: 20px 24px;
        margin-top: 20px;
        background-color: rgba(26, 26, 26, 0.7);
        border-left: 3px solid rgba(255, 255, 255, 0.6);
    }

    body.inverted .response {
        background-color: rgba(250, 250, 250, 0.7);
        border-left: 3px solid rgba(0, 0, 0, 0.6);
    }

    textarea {
        font-size: 1rem;
        padding: 16px;
        min-height: 100px;
    }

    .primary-btn {
        width: 100%;
        padding: 18px;
        font-size: 1rem;
    }

    .privacy-notice {
        font-size: 0.75rem;
        margin-top: -12px;
    }

    .share-btn {
        bottom: auto;
        top: 16px;
        right: 16px;
        padding: 10px 20px;
        font-size: 0.8rem;
    }

    .loading {
        top: 20%;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .subheadline {
        font-size: 0.9rem;
    }

    .statue-container {
        min-height: 450px;
    }

    .statue {
        min-height: 300px;
    }

    .response {
        font-size: 0.95rem;
        padding: 18px 20px;
    }

    .share-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }
}
