/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #d4af86 0%, #8b6f47 50%, #6b4e3d 100%);
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Decorative background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.08) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 80px 80px, 60px 60px;
    pointer-events: none;
    z-index: -1;
}

/* Header styles */
header {
    text-align: center;
    padding: 1rem 2rem;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
}

h1 {
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
    font-weight: 400;
    letter-spacing: 0.5px;
}

h1 small {
    font-size: 1rem;
    color: #d4af86;
    font-style: italic;
    opacity: 0.9;
    font-weight: 300;
}

.mission {
    font-style: italic;
    color: #d4af86;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Container styles */
.container {
    flex: 1;
    max-width: 900px;
    width: 95%;
    margin: 1rem auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(20px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Input section */
.input-section {
    padding: 1.5rem;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

.description {
    text-align: center;
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.4;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

select, textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

select:focus, textarea:focus {
    border-color: #8b6f47;
    box-shadow: 0 0 0 2px rgba(139, 111, 71, 0.12);
    outline: none;
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Button styles */
button {
    background: linear-gradient(135deg, #8b6f47 0%, #6b4e3d 100%);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(139, 111, 71, 0.4);
}

button:active {
    transform: translateY(-1px);
}

.button-icon {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

button:hover .button-icon {
    transform: translateX(4px);
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 1.5rem;
    background: rgba(248, 249, 250, 0.9);
}

.spinner {
    border: 3px solid rgba(139, 111, 71, 0.2);
    border-top: 3px solid #8b6f47;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1.2s linear infinite;
    margin: 0 auto 1rem;
}

.loading-spinner p {
    color: #6c757d;
    font-style: italic;
    font-size: 0.95rem;
}

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

/* Result section */
.result-section {
    padding: 1.5rem;
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    border-top: 1px solid #e9ecef;
}

.result-section h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 400;
}

.translation-container {
    position: relative;
    background: rgba(139, 111, 71, 0.08);
    padding: 1.3rem;
    border-radius: 10px;
    border-left: 3px solid #8b6f47;
    margin-bottom: 1rem;
}

#translation {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0;
    color: #2c3e50;
}

.copy-button {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(139, 111, 71, 0.1);
    border: 1px solid rgba(139, 111, 71, 0.3);
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.copy-button:hover {
    background: rgba(139, 111, 71, 0.2);
    transform: scale(1.1);
}

/* References section */
.references-details {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.references-details summary {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #8b6f47 0%, #6b4e3d 100%);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}

.references-details summary:hover {
    background: linear-gradient(135deg, #6b4e3d 0%, #5a3f32 100%);
}

.references-details summary::after {
    content: '▼';
    position: absolute;
    right: 2rem;
    transition: transform 0.3s ease;
}

.references-details[open] summary::after {
    transform: rotate(180deg);
}

#references {
    list-style: none;
    padding: 1.5rem;
    background: #f8f9fa;
}

#references li {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#references li:hover {
    background: rgba(139, 111, 71, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#references li:last-child {
    margin-bottom: 0;
}

/* Footer */
footer {
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 1rem 1.5rem;
    margin-top: auto;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

footer p {
    line-height: 1.4;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.contact {
    font-size: 0.9rem;
}

footer a {
    color: #d4af86;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

footer a:hover {
    color: white;
    background: rgba(212, 175, 134, 0.2);
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        padding: 0.6rem 1rem;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h1 small {
        font-size: 0.85rem;
    }
    
    .mission {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    .container {
        margin: 0.8rem auto;
        width: 98%;
    }
    
    .input-section, .result-section {
        padding: 1rem;
    }
    
    .translation-container {
        padding: 1rem;
    }
    
    #translation {
        font-size: 1rem;
    }
    
    textarea {
        min-height: 70px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem 0.8rem;
    }
    
    .header-title {
        gap: 0.2rem;
        margin-bottom: 0.4rem;
    }
    
    h1 {
        font-size: 1.2rem;
        text-align: center;
    }
    
    h1 small {
        font-size: 0.75rem;
    }
    
    .mission {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .input-section, .result-section {
        padding: 0.8rem;
    }
    
    select, textarea, button {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    textarea {
        min-height: 60px;
    }
    
    .translation-container {
        padding: 1rem;
    }
    
    #translation {
        font-size: 0.95rem;
    }
    
    .copy-button {
        position: static;
        margin-top: 0.8rem;
        width: auto;
        align-self: flex-end;
    }
    
    .translation-container {
        display: flex;
        flex-direction: column;
    }
    
    footer {
        padding: 0.8rem;
    }
    
    footer p {
        font-size: 0.8rem;
    }
    
    .contact {
        font-size: 0.85rem;
    }
}

/* Animation for smooth transitions */
.container, .result-section, .loading-spinner {
    animation: fadeInUp 0.6s ease-out;
}

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