/* css/style.css */

:root {
    /* Renkler */
    --c-primary: #10b981;
    --c-primary-dark: #059669;
    --c-danger: #ef4444;
    --c-danger-dark: #dc2626;
    --c-warning: #fb923c;
    --c-warning-dark: #f59e0b;
    --c-super: #8b5cf6;
    --c-super-dark: #a78bfa;
    --c-info: #3b82f6;
    --c-bg: #0f172a;
    --c-bg-light: #1e293b;
    --c-text: #ffffff;
    --c-text-muted: rgba(255, 255, 255, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none; /* Kiosk için seçim engeli */
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--c-bg);
    color: var(--c-text);
    overflow: hidden; /* Scroll engeli */
    width: 100vw;
    height: 100vh;
}

h1, h2, h3, h4, h5, h6, .font-fredoka {
    font-family: 'Fredoka One', cursive;
}

/* EKRAN YÖNETİMİ */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
    padding: 20px;
    z-index: 10;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

/* ANIMASYONLAR */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
.bounce { animation: bounce 1s infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.float { animation: float 3s ease-in-out infinite; }

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.pulse { animation: pulse 2s infinite; }

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}
.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }

@keyframes pop {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.pop { animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.slideUp { animation: slideUp 0.4s ease forwards; }

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.rainbow-bg {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 1400% 100%;
    animation: rainbow 1.5s ease infinite;
}

@keyframes scan-anim {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

/* BUTONLAR */
button {
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 20px;
    transition: all 0.2s ease;
}
button:active {
    transform: scale(0.95);
}

.btn-g {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: white;
    padding: 15px 30px;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}
.btn-g:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-r {
    background: linear-gradient(135deg, var(--c-danger), var(--c-danger-dark));
    color: white;
    padding: 15px 30px;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-o {
    background: transparent;
    color: var(--c-primary);
    border: 2px solid var(--c-primary);
    padding: 10px 20px;
    font-size: 1rem;
}

.btn-hidden {
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: 0.1;
    background: transparent;
    color: white;
    padding: 10px;
    font-size: 12px;
}

/* SPLASH SCREEN */
.mascot {
    font-size: 100px;
    margin-bottom: 20px;
}
.title-gradient {
    font-size: 4rem;
    background: -webkit-linear-gradient(45deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.subtitle {
    font-size: 1.5rem;
    color: var(--c-text-muted);
    margin-bottom: 40px;
}
.loading-bar {
    width: 200px;
    height: 10px;
    border-radius: 5px;
}

/* OKUL SEÇİM */
.header-text {
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.grid-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    max-width: 800px;
}
.school-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    width: 200px;
    transition: all 0.3s ease;
    opacity: 0; /* slideUp öncesi */
}
.school-card:hover, .school-card:active {
    transform: translateY(-10px);
    border-color: var(--c-primary);
    background: rgba(16, 185, 129, 0.1);
}
.school-card .logo {
    font-size: 3rem;
    margin-bottom: 15px;
}
.school-card .s-name {
    font-weight: 700;
    font-size: 1.2rem;
}
.school-card .s-city {
    color: var(--c-text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* GİRİŞ EKRANI */
.top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
}
.school-badge {
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
}
.numpad-container {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.no-display {
    width: 300px;
    height: 80px;
    border: 3px solid var(--c-primary);
    border-radius: 20px;
    font-size: 3rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(16, 185, 129, 0.1);
    letter-spacing: 5px;
}
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
.num-btn {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: white;
}
.num-btn:active {
    background: rgba(255,255,255,0.3);
}
.btn-danger { background: rgba(239, 68, 68, 0.2); color: var(--c-danger); }
.btn-success { background: rgba(16, 185, 129, 0.2); color: var(--c-primary); }

/* TARAMA EKRANI */
.header-scan {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.student-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 30px;
}
.student-info .photo { font-size: 2rem; }
.student-info .name { font-weight: bold; font-size: 1.2rem; }
.student-info .class { color: var(--c-text-muted); font-size: 0.9rem; }
.status-indicator {
    width: 20px;
    height: 20px;
    background: var(--c-primary);
    border-radius: 50%;
}
.allergy-band {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 80px;
    flex-wrap: wrap;
    justify-content: center;
}
.allergy-tag {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
}
.camera-area {
    position: relative;
    width: 80vw;
    max-width: 400px;
    height: 400px;
    background: #000;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.camera-frame {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 2px dashed rgba(255,255,255,0.3);
}
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--c-primary);
    box-shadow: 0 0 10px var(--c-primary);
    animation: scan-anim 2s linear infinite;
    display: none; /* Sadece tararken göster */
}
.scan-message-bubble {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.9);
    color: #000;
    padding: 5px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 0.8rem;
    white-space: nowrap;
}
.scan-btn {
    width: 80vw;
    max-width: 400px;
    height: 80px;
    font-size: 2rem;
    border-radius: 40px;
}

.barcode-sim {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
}
.barcode-sim select {
    padding: 10px;
    border-radius: 10px;
    font-size: 16px;
    width: 80%;
}

/* SONUÇ EKRANI */
.result-bg {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.5s ease;
}
.result-bg.safe { background: linear-gradient(135deg, var(--c-primary-dark), #022c22); }
.result-bg.risk { background: linear-gradient(135deg, var(--c-danger-dark), #450a0a); }

.result-icon { font-size: 6rem; margin-bottom: 20px; }
.result-title { font-size: 4rem; text-shadow: 0 0 20px rgba(255,255,255,0.5); margin-bottom: 10px; }
.result-message { font-size: 1.5rem; margin-bottom: 30px; font-weight: bold; text-align: center; }

.product-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}
.product-card .p-img { font-size: 4rem; margin-bottom: 10px; }
.product-card .p-name { font-size: 1.5rem; font-weight: bold; }
.product-card .p-brand { color: var(--c-text-muted); margin-bottom: 15px; }
.product-card .p-allergens { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.product-card .p-sugar { font-weight: bold; font-size: 1.1rem; }

.warning-box {
    background: rgba(0,0,0,0.3);
    border-left: 5px solid var(--c-danger);
    padding: 15px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    margin-bottom: 30px;
}
.warning-box h4 { color: var(--c-danger); margin-bottom: 10px; }
.matched-list { display: flex; gap: 10px; flex-wrap: wrap; }
.matched-item { 
    background: var(--c-danger); 
    padding: 5px 10px; 
    border-radius: 10px; 
    font-weight: bold; 
    animation: pulse-red 1s infinite;
}

.new-scan-btn { width: 90%; max-width: 400px; }
