
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

:root {
    --primary-color: #1434CB;
    --secondary-color: #fff;
    --accent-color: #1434CB;
    --button-bg: #333;
    --button-text: #fff;
    --light-gray: #f0f0f0;
    --medium-gray: #ccc;
    --dark-gray: #B8B8B8;
    --background-color: #F5F5F5;
    --text-color: #5E5E5E;

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;

    font-family: var(--font-sans), serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
    font-feature-settings: "liga" 1, "kern" 1;
}

body h1,
body h2,
body h3,
body h4 {
    color: var(--primary-color);
    margin: 0;
}

body p {
    color: var(--text-color);
    font-family: Inter, serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 100%;
    letter-spacing: 0;
    text-align: center;
}

.main-container {
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    overflow: hidden;
    display: flex;
    gap: 0;
    flex-direction: column;
    position: relative;
}

.app-container {
    width: 100%;
    max-width: 393px;
    height: calc(100vh - 64px);
    max-height: 950px;
    background-color: var(--background-color);
    overflow: auto;
    display: flex;
    gap: 0;
    flex-direction: column;
    position: relative;
    margin: 0 auto;
}

.header {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #ECECEC;
}

.header-inner {
    height: 64px;
    max-width: 393px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.header-inner img {
    height: 28px;
    width: auto;
    display: block;
    margin: 0;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switch button {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;

    font: 500 14px/1 var(--font-sans, system-ui);
    text-transform: lowercase;
    color: #9AA0A6;
}

.lang-switch button:hover {
    color: #6B7280;
}

.lang-switch.show-current-only button:not(.is-active) {
    display: none;
}

.screen {
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 32px;
    box-sizing: border-box;
    text-align: center;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: fadeIn 0.5s ease-in-out;
}

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

.screen.active {
    display: flex;
    gap: 0;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

h2 {
    margin-bottom: 15px;
    font-family: Inter, serif;
    font-weight: 700;
    font-size: 25px;
    line-height: 100%;
    letter-spacing: 0;
    text-align: center;
}

.button {
    display: inline-block;
    width: 100%;
    height: 40px;
    margin-top: 25px;
    border-radius: 250px;
    background-color: var(--accent-color);
    color: var(--button-text);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;

    font-family: Inter, serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

#start-button {
    height: 50px;
    font-size: 20px;
}

#retake-button {
    margin-top: 24px;
}

.button:active {
    transform: scale(0.98);
}

.button-secondary {
    background-color: var(--dark-gray);
}

/* --- Specific Screen Styles --- */

/* Welcome Screen */
#welcome-screen img {
    width: 80%;
    max-width: 250px;
    border-radius: 15px;
    margin-bottom: 25px;
}

#welcome-screen p {
    font-family: Inter, serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 25px 0 0;
}

/* GDPR Screen */
#gdpr-screen {
    justify-content: flex-start;
}

.gdpr-content h2 {
    margin: 0;
    font-size: 20px;
}

.gdpr-content h4 {
    margin: 0;
    font-size: 14px;
}

.gdpr-content {
    margin-top: 25px;
    color: var(--primary-color);
    overflow-y: auto;
    max-height: 400px;
    text-align: left;
}

.gdpr-content h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

.gdpr-content p {
    color: #666;
    text-align: left !important;
    font-family: Inter, serif;
    font-size: 12px;
    line-height: 100%;
    letter-spacing: 0;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    margin-top: 25px;
}

.button-group .button {
    width: 100%;
    height: 40px;
    margin-top: 0;
}

/* Camera Screen */
#camera-screen {
    padding: 0;
    margin: 32px;
    width: calc(100% - 66px);
    height: calc(100% - 66px);
}

#camera-feed {
    width: 329px;
    height: 329px;
    object-fit: cover;
    margin-top: 25px;
    border-radius: 20px;
}

#capture-button {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);

    width: 75px;
    height: 75px;
    border-radius: 50%;

    background-color: var(--primary-color);
    border: 5px solid #fff;

    cursor: pointer;
    z-index: 10;

    box-shadow: 0 0 0 5px var(--primary-color);
}

#camera-error {
    color: #ff4d4d;
    position: absolute;
    bottom: 120px;
    background-color: rgba(0,0,0,0.7);
    padding: 10px;
    border-radius: 5px;
}

/* Confirm Photo Screen */
#confirm-photo-screen img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#confirm-photo-screen h2 {
    margin-bottom: 25px;
}

/* Mood Screen */
.mood-grid {
    display: block;
    width: 100%;
    padding: 0;
}
.mood-button {
    width: 100%;
    height: 45px;
    margin-bottom: 15px;
    margin-top: 0;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 500px;

    font-family: Inter, serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

/* Name Screen */
#name-input {
    width: 80%;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    background-color: var(--secondary-color);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 10px;
    margin-top: 20px;
}

#name-input::placeholder {
    color: var(--primary-color);
    opacity: 0.5;
}

/* Generating Screen */

#generating-screen h2,
#select-result-screen h2,
#final-screen h2 {
    margin-bottom: 25px;
}

#generating-screen p,
#select-result-screen p,
#final-screen p {
    margin: 0 0 25px;
}

.loader {
    border: 8px solid var(--dark-gray);
    border-top: 8px solid var(--accent-color);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1.5s linear infinite;
    margin-bottom: 30px;
}

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

/* Select Result Screen */
.result-grid {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.result-image-container {
    position: relative;
    border-radius: 8px;
    border: 4px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background-color: var(--dark-gray);
}

.result-image-container.selected {
    border-color: var(--accent-color);
}

.result-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: none;
    border-radius: 0;
}

.initials-overlay {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-family: 'Roboto', sans-serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 12vw, 2.5rem);
    text-transform: uppercase;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, -2px 0 3px rgba(0,0,0,0.5);
    pointer-events: none;
    text-align: center;
    width: 100%;
    line-height: 1;
}

#mood-screen h2 {
    margin-bottom: 25px;
}

#final-screen .save-hint {
    font-size: 0.8rem;
    color: var(--medium-gray);
}

#final-image-container {
    margin: 20px 0;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

#final-image-preview {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

#final-image-container .initials-overlay {
    font-size: clamp(2.5rem, 15vw, 4rem);
}

#download-button {
    height: 40px;
    width: 100%;
    margin-top: 25px;
    font-family: Inter, serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.camera-wrapper {
    position: relative;
}