/* General Body and Container Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top for longer content */
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Hero Section / Title Styles */
.hero-title {
    text-align: center;
    color: #007bff; /* A vibrant blue for main titles */
    margin-bottom: 15px;
    font-size: 2.5em;
    font-weight: 700;
}

.hero-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Translator Box Styles */
.translator-box {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.language-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.language-option {
    flex: 1;
}

.language-option select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    background-color: #fff;
    appearance: none; /* Remove default arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M287%2C197.3L159.5%2C69.8c-2.4-2.4-5.9-4.2-9.4-4.2s-7.1%2C1.7-9.4%2C4.2L5.4%2C197.3c-7.2%2C7.2-7.2%2C18.8%2C0%2C26.1c7.2%2C7.2%2C18.8%2C7.2%2C26.1%2C0l124.9-124.9l124.9%2C124.9c7.2%2C7.2%2C18.8%2C7.2%2C26.1%2C0C294.2%2C216.1%2C294.2%2C204.5%2C287%2C197.3z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 12px auto;
    cursor: pointer;
}

.swap-btn {
    background-color: #007bff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.swap-btn:hover {
    background-color: #0056b3;
    transform: rotate(15deg);
}

.swap-btn svg {
    fill: #fff;
    width: 20px;
    height: 20px;
}

.text-areas {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.text-area {
    flex: 1;
}

.text-area textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1.1em;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.text-area textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

#translate-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background-color: #28a745; /* Green for action */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#translate-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

#loading-indicator {
    text-align: center;
    margin-top: 15px;
    font-style: italic;
    color: #6c757d;
    display: none; /* Hidden by default */
}

#error-message {
    text-align: center;
    margin-top: 15px;
    color: #dc3545; /* Red for errors */
    font-weight: bold;
    display: none; /* Hidden by default */
}

/* Translation Actions (Like Button) */
.translation-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
}

.translation-actions .action-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.translation-actions .action-btn:hover {
    background-color: #0056b3;
}

.translation-actions .action-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Hidden Utility Class */
.hidden {
    display: none !important;
}

/* History Section */
.history {
    margin-top: 40px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.history h2 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

#history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background-color: #fff;
    border: 1px solid #eee;
    border-left: 5px solid #007bff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.history-item strong {
    color: #333;
    font-size: 1.1em;
    display: block;
    margin-bottom: 5px;
}

.history-item span {
    color: #555;
    display: block;
    font-size: 0.95em;
}

/* Suggestion and Feedback Boxes (New Sections) */
.suggestion-box,
.feedback-box {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.suggestion-box h2,
.feedback-box h2 {
    text-align: center;
    color: #007bff;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group textarea {
    width: calc(100% - 20px); /* Account for padding */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: #6c757d; /* Grey for general submit */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-submit:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Star Rating for Feedback */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.star-rating i {
    color: #ccc; /* Default grey star */
    font-size: 1.8em;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.star-rating i.fas { /* Filled star */
    color: #ffc107; /* Golden yellow */
}

.star-rating i:hover {
    transform: scale(1.1);
}

/* Messages (Success/Error) */
.message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    display: none; /* Hidden by default, shown by JS */
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .hero-title {
        font-size: 2em;
    }

    .language-selector {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        gap: 15px;
        
    }

    .swap-btn {
        margin: 10px 0;
    }

    .text-areas {
        flex-direction: column;
        gap: 15px;
    }

    .text-area textarea {
        height: 120px;
        font-size: 1em;
    }

    .history h2, .suggestion-box h2, .feedback-box h2 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .hero-title {
        font-size: 1.8em;
    }

    .text-area textarea {
        height: 100px;
        padding: 10px;
    }

    .btn-submit, #translate-btn, .action-btn {
        font-size: 1em;
        padding: 10px 15px;
    }
}