
/* =========================================================
   IndicAI - Intelligent Indian Language Translator
   Main stylesheet
   ========================================================= */

/* 1. Global settings */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2864ad;
    --primary-dark: #1d4f91;
    --primary-light: #eaf2fc;
    --navy: #142a49;
    --background: #f2f6fc;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #dce5f1;
    --success: #16835d;
    --danger: #c24141;
}

html {
    min-height: 100%;
    scroll-behavior: auto;
}

body {
    min-height: 100vh;
    width: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
    background: var(--background);
    color: var(--text);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* 2. Website header */

header {
    width: 100%;
    min-height: 65px;
    padding: 12px 6%;
    background: var(--navy);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 3px solid var(--primary);
}

.logo {
    font-size: 27px;
    font-weight: 750;
    letter-spacing: -0.8px;
}

.tagline {
    color: #c1d0e5;
    font-size: 14px;
}

/* 3. Main application container */

.container {
    width: min(1100px, 94%);
    margin: 18px auto;
    padding: 21px 35px;
    background: var(--surface);
    border: 1px solid #e3eaf4;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(28, 52, 88, 0.07);
    text-align: center;
}

/* 4. Interface language selector */

.interface-language {
    max-width: 600px;
    margin: 0 auto 16px;
}

.interface-language form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.interface-language label {
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: 650;
    color: #334155;
    margin-bottom: 1px;
}

.interface-language select {
    flex: 1;
    min-width: 150px;
}

select {
    width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #ffffff;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40, 100, 173, 0.12);
}

.interface-button {
    min-height: 42px;
    padding: 9px 24px;
    border: none;
    border-radius: 9px;
    background: var(--primary);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.2s;
}

.interface-button:hover {
    background: var(--primary-dark);
}

/* 5. Main heading */

h1 {
    color: #193f70;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 750;
    letter-spacing: -0.8px;
    line-height: 1.25;
}

.subtitle {
    margin: 7px 0 18px;
    color: var(--muted);
    font-size: 15px;
}

/* 6. Translator workspace */

.translator {
    display: flex;
    align-items: stretch;
    gap: 22px;
    width: 100%;
    text-align: left;
}

.language-box {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    margin-bottom: 7px;
    color: #26364d;
    font-size: 14px;
    font-weight: 650;
}

.language-box select {
    margin-bottom: 9px;
}

/* 7. Text input and output */

textarea {
    width: 100%;
    height: 155px;
    min-height: 125px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: #17253a;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40, 100, 173, 0.10);
}

textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

textarea[readonly] {
    background: #f7faff;
    color: #17253a;
    cursor: text;
}

/* 8. Action buttons */

.button-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 13px;
}

.button-group button {
    min-height: 44px;
    padding: 9px 25px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.button-group button:hover {
    transform: translateY(-1px);
}

.button-group button:active {
    transform: translateY(0);
}

.button-group button:focus-visible {
    outline: 3px solid rgba(40, 100, 173, 0.25);
    outline-offset: 2px;
}

.translate-button {
    min-width: 180px;
    background: var(--primary);
    color: white;
}

.translate-button:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(40, 100, 173, 0.18);
}

.swap-button {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: #d9e7f8 !important;
}

.swap-button:hover {
    background: #dceafa;
}

.clear-button {
    background: #f1f4f8;
    color: #475569;
    border-color: #e1e7ef !important;
}

.clear-button:hover {
    background: #e5ebf3;
}

/* 9. Translation status */

.message {
    max-width: 700px;
    margin: 11px auto 0;
    padding: 9px 15px;
    border: 1px solid #dce8f8;
    border-radius: 8px;
    background: #f2f7ff;
    color: var(--primary-dark);
    font-size: 14px;
    text-align: center;
    overflow-wrap: anywhere;
}

/* 10. Supported languages */

.languages {
    margin-top: 19px;
}

.languages h2 {
    color: #26364d;
    font-size: 18px;
    font-weight: 700;
}

.language-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 9px;
}

.language-list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 75px;
    padding: 7px 15px;
    border: 1px solid #dce8f8;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 600;
}

/* 11. Footer */

footer {
    width: 100%;
    margin-top: auto;
    padding: 10px 12px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

/* 12. Short laptop screens */

@media (min-width: 900px) and (max-height: 760px) {
    header {
        min-height: 55px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .container {
        margin-top: 10px;
        margin-bottom: 10px;
        padding: 16px 28px;
    }

    .interface-language {
        margin-bottom: 10px;
    }

    .subtitle {
        margin-top: 5px;
        margin-bottom: 13px;
    }

    textarea {
        height: 135px;
        min-height: 110px;
    }

    .button-group {
        margin-top: 9px;
    }

    .languages {
        margin-top: 12px;
    }

    .language-list {
        margin-top: 7px;
    }

    footer {
        padding: 6px;
    }
}

/* 13. Tablet screens */

@media (max-width: 850px) {
    .container {
        width: 95%;
        padding: 22px;
    }

    .translator {
        gap: 15px;
    }

    textarea {
        font-size: 16px;
    }
}

/* 14. Mobile screens */

@media (max-width: 650px) {
    header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .logo {
        font-size: 24px;
    }

    .tagline {
        font-size: 13px;
    }

    .container {
        width: calc(100% - 20px);
        margin: 14px auto;
        padding: 19px 15px;
        border-radius: 12px;
    }

    h1 {
        font-size: 25px;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 17px;
    }

    .interface-language {
        width: 100%;
        margin-bottom: 17px;
    }

    .interface-language form {
        flex-direction: column;
    }

    .interface-language select,
    .interface-button {
        width: 100%;
    }

    .translator {
        flex-direction: column;
        gap: 14px;
    }

    .language-box {
        width: 100%;
    }

    textarea {
        height: 145px;
        min-height: 125px;
        font-size: 16px;
        padding: 12px;
    }

    .button-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 9px;
        margin-top: 12px;
    }

    .button-group button {
        width: 100%;
        min-width: 0;
        padding: 10px 8px;
        font-size: 14px;
    }

    .translate-button {
        grid-column: 1 / -1;
    }

    .languages {
        margin-top: 19px;
    }

    .language-list {
        gap: 7px;
    }

    .language-list span {
        min-width: 65px;
        padding: 7px 10px;
        font-size: 13px;
    }

    footer {
        padding: 11px 10px;
        font-size: 12px;
    }
}

/* 15. Very small mobile screens */

@media (max-width: 360px) {
    .container {
        padding: 17px 12px;
    }

    h1 {
        font-size: 22px;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .translate-button {
        grid-column: auto;
    }

    .language-list span {
        min-width: 58px;
        padding: 6px 8px;
    }
}
