/* CSS variables (Design System) */


:root {
    --primary-blue: #4A90E2;
    --background-white: #FFFFFF;
    --light-gray: #F7F7F7;
    --dark-gray: #333333;
    --turquoise: #4DB6AC;
}

/* Reset and base styles */

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

body {
    font-family: 'Open Sans', Arial, sans-serif;
    background-color: var(--background-white);
    color: var(--dark-gray);
    line-height: 1.6;
    min-height: 100vh; /* Mindestens so hoch wie das Display */
    overflow-y: auto;  /* Erlaubt vertikales Scrollen, wenn nötig */
}

/* Typography */

h1, h2, h3 {
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: bold;
}

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

h2 {
    font-size: 24px;
}

p {
    font-size: 16px;
}

/* Layout containers */

.container {
    max-width: 430px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 120px; /*space for bottom nav */
    box-sizing: border-box;
}

.action-and-mascot-container {
    position: relative;      /* Referenz für das Maskottchen */
    width: 100%;
    display: flex;
    justify-content: center; /* Button exakt wie vorher */
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

.welcome-circle {
    width: 150px;
    height: 150px;

    /* HIER IST DIE FARBE: Ein dunkler Mix aus deinen App-Farben */
    background: linear-gradient(135deg, #4DB6AC, #4A90E2);
    border-radius: 50%; /* Macht es rund */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px auto; /* Zentriert den Kreis */

    /* Animation & Schatten */
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    overflow: hidden;
}

.side-mascot {
    position: absolute;
    right: calc(50% - 140px); /* rechts vom Button */
    width: 80px;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}

/* Buttons */

.btn-primary {
    background-color: var(--turquoise);
    color: white;
    border: none;
    padding: 16px 48px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 200px;
}

.btn-primary:hover {
    background-color: #45a89e;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Bottom navigation */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0; /* reduced from 12px */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    max-width: 430px;
    margin: 0 auto;
    z-index: 100;
    min-height: 60px; /* ensure minimum height */
}

.nav-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 24px;
    text-decoration: none;
}

.nav-icon:hover {
    background-color: var(--light-gray);
    transform: scale(1.1);
}

.nav-icon.active {
    background-color: var(--turquoise);
    transform: scale(1.2);
}

/* Welcome screen */

.mascot-container {
    margin-bottom: 20px;
    margin-top: -10px;
}

.mascot {
    width: 200px;
    height: 200px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

.welcome-mascot-circle {
    width: 160px;
    height: 160px;
    background: #1a2a3a; /* Dunkler Kreis-Hintergrund */
    border-radius: 50%;   /* Macht es rund */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto; /* Zentriert den Kreis und gibt Abstand nach unten */
    animation: float 3s ease-in-out infinite; /* Die Schweb-Animation */
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    overflow: hidden;
}

.welcome-img {
    width: 90%; /* Bild ist etwas kleiner als der Kreis */
    height: 90%;
    object-fit: contain;
}

.mascot-placeholder {
    background: linear-gradient(135deg, #4DB6AC,
    #4A90E2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 80px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.title-container {
    text-align: center;
    margin-bottom: 60px;
}

.app-title {
    background: linear-gradient(135deg,
    var(--turquoise), var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 48px;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--primary-blue);
    font-size: 16px;
    font-weight: 400;
}

/* Explorer screen */

.page-title {
    text-align: center;
    color: var(--turquoise);
    margin-bottom: 10px;
    margin-top: 20px;
}

.permission-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0;
    margin-bottom: 30px;
    margin-top: 20px;
}

.speech-bubble {
    background-color: white;
    border: 2px solid var(--light-gray);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    position: relative;
    font-size: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 280px;
}

/* Speech bubble arrow */

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid white;
}

.mascot-small {
    width: 150px;
    height: 150px;
    font-size: 60px;
}

/* Camera screen */

.camera-container {
    position: fixed; /* changed from relative */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 430px;
    height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background-color: black;
}

.camera-view {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ar viewfinder overlay */
.camera-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border: 3px solid white;
    border-radius: 20px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.camera-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
    max-width: 80%;
    text-align: center;
}

.camera-controls {
    position: fixed; /* changed from absolute */
    bottom: 80px; /* reduced from 100px to fit better */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.capture-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: white;
    border: 4px solid var(--turquoise);
    cursor: pointer;
    transition: all 0.2s;
}

.capture-mascot {
    width: 42px;
    height: auto;
    object-fit: contain;
    animation: none;      /* bewusst ruhig */
    pointer-events: none; /* Klick geht auf Button */
}

.capture-btn:active {
    transform: scale(0.95);
    background-color: var(--turquoise);
}

/* detection labels */
.detection-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.detection-label {
    position: absolute;
    background-color: rgba(77, 182, 172, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -100%);
    white-space: nowrap;
}

.detection-label.primary {
    background-color: rgba(245, 166, 35, 0.95);
    font-size: 16px;
    padding: 10px 16px;
}

/* Result screen */

.result-container {
    max-width: 430px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
    min-height: 100vh;
}

.result-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.result-card {
    background-color: white;
    border: 2px solid var(--light-gray);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    position: relative;
}

.result-mascot {
    position: absolute;
    top: -30px;
    right: 20px;
}

.result-container .mascot {
    animation: none;
}

.result-mascot .mascot-small {
    width: 120px;
    height: 120px;
}

.word-title {
    font-size: 36px;
    color: var(--dark-gray);
    margin-bottom: 10px;
    margin-top: 10px;
}

.pronunciation {
    font-size: 18px;
    color: var(--primary-blue);
    font-style: italic;
    margin-bottom: 20px;
}

.definition {
    font-size: 16px;
    color: var(--dark-gray);
    margin-bottom: 20px;
    line-height: 1.6;
}

.example {
    font-size: 14px;
    color: #666;
    font-style: italic;
    padding: 15px;
    background-color: var(--light-gray);
    border-radius: 10px;
    border-left: 4px solid var(--turquoise);
    line-height: 1.5;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.result-actions button {
    flex: 1;
}

.btn-secondary {
    background-color: white;
    color: var(--turquoise);
    border: 2px solid var(--turquoise);
    padding: 14px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--light-gray);
}

.btn-secondary:active {
    transform: scale(0.98);
}


/* Collection screen */

.collection-container {
    max-width: 430px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
    min-height: 100vh;
}

.collection-header {
    text-align: center;
    margin-bottom: 20px;
}

.collection-title-with-mascot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

/* kleines, ruhiges Lexi */
.collection-mascot {
    width: 90px;
    height: auto;
    object-fit: contain;
    animation: none; /* bewusst ruhig */
}

.search-bar {
    width: 100%;
    max-width: 350px;
    padding: 12px 20px;
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    font-size: 16px;
    margin: 20px auto;
    display: block;
    transition: border-color 0.3s;
}

.search-bar:focus {
    outline: none;
    border-color: var(--turquoise);
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.collection-card {
    background-color: white;
    border: 2px solid var(--light-gray);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--turquoise);
}

.collection-card:active {
    transform: translateY(-2px);
}

.card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    background-color: var(--light-gray);
}

.card-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
}

.card-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--dark-gray);
}

.card-date {
    font-size: 12px;
    color: #999;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 18px;
    color: var(--dark-gray);
    margin-bottom: 30px;
}

.hidden {
    display: none;
}


/* Settings screen */

.settings-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.profile-header {
    margin: 15px 0 10px 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.profile-circle {
    width: clamp(100px, 25vh, 150px);
    height: clamp(100px, 25vh, 150px);
    background-color: #E0F2F1;
    border-radius: 50%;
    border: 2px solid #B0BEC5;
    overflow: hidden;
}

.profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 20%;
}

.settings-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    text-align: left;
    padding: 15px 20px;
}

.settings-btn .icon {
    margin-right: 15px;
    font-size: 24px;
    display: flex;
    align-items: center;
    min-width: 30px;
}

/* Success banner */


/* Utility */