/* --- Base Styling & Variables --- */
:root {
    --background-color: #1a1a2e; /* Deep blue night sky */
    --primary-color: #1f4287;   /* Darker blue */
    --secondary-color: #27496d; /* Muted blue for containers */
    --accent-color: #00a8cc;     /* Bright cyan accent */
    --text-color: #e0e0e0;       /* Off-white text */
    --header-font: 'Bungee', cursive;
    --body-font: 'Roboto', sans-serif;
    --border-radius: 12px;
}

body {
    font-family: var(--body-font);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- Main Layout Container --- */
.container {
    width: 100%;
    max-width: 700px;
    padding: 20px;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-family: var(--header-font);
    color: var(--accent-color);
    font-size: 2.5rem;
    text-shadow: 2px 2px 8px rgba(0, 168, 204, 0.4);
    margin: 0;
}

/* --- Central Content Box --- */
.content-box {
    background-color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.description {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Form Elements --- */
#translate-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

textarea#text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    font-family: var(--body-font);
    font-size: 1rem;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea#text-input::placeholder {
    color: #8a8d9f;
}

textarea#text-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 168, 204, 0.3);
}

button#submit-button {
    padding: 1rem;
    font-family: var(--header-font);
    font-size: 1.2rem;
    background: linear-gradient(45deg, var(--accent-color), #007bff);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px; /* Ensure button height is consistent */
}

button#submit-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 168, 204, 0.4);
}

button#submit-button:disabled {
    background: #555;
    cursor: not-allowed;
}

/* --- Status and Result Sections --- */
.status-container, .result-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: rgba(31, 66, 135, 0.5);
    border-radius: var(--border-radius);
    text-align: center;
}

#status-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent-color);
}

.result-container h2 {
    font-family: var(--header-font);
    color: var(--accent-color);
    margin-top: 0;
}

.result-text {
    background-color: var(--primary-color);
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
    white-space: pre-wrap; /* Preserves line breaks from the AI */
    line-height: 1.7;
    font-size: 1.05rem;
    min-height: 50px;
}

.copy-button {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.copy-button:hover {
    background-color: var(--accent-color);
    color: var(--background-color);
}


/* --- Loading Spinner --- */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #fff;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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


/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 2.5rem;
    color: #8a8d9f;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.donate-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--header-font);
    font-size: 1rem;
    background: #ffc439; /* PayPal Gold */
    color: #003087; /* PayPal Blue */
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.donate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 196, 57, 0.4);
}

/* --- Dashboard Specific Styles --- */
.dashboard-header {
    font-size: 2rem;
    color: #fff;
}

.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.stat-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-family: var(--body-font);
    font-size: 1.1rem;
    color: #e0e0e0;
    font-weight: 500;
}

.stat-card .stat-number {
    font-family: var(--header-font);
    font-size: 2.5rem;
    color: var(--accent-color);
    margin: 0;
}

.chart-container {
    background-color: var(--secondary-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    height: 400px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.chart-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-family: var(--body-font);
    font-weight: 500;
}


/* --- Responsive Design --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    header h1 {
        font-size: 2rem;
    }
    .content-box {
        padding: 1.5rem;
    }
}
