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

:root {
    --font-primary: 'Outfit', sans-serif;
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.75);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --accent-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    
    /* Stroop Colors mapped to premium hex codes */
    --color-red: #ef4444;
    --color-blue: #3b82f6;
    --color-green: #10b981;
    --color-yellow: #eab308;
    --color-black: #0f172a;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 40%);
}

header {
    padding: 1.5rem 2rem;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
}

h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.form-input.invalid {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25) !important;
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #c084fc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.5rem;
    text-transform: none;
    letter-spacing: 0px;
}

.tab {
    display: none;
    animation: tabFadeIn 0.3s ease-in-out;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.6);
}

.btn-accent {
    background: var(--accent-gradient);
    color: white;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(236, 72, 153, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Stroop Game Layout */
.game-container {
    text-align: center;
}

.progress-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.progress-bar {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.level-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Light background container for the stimulus to make "black" font visible */
.stimulus-canvas {
    background-color: #f8fafc;
    border-radius: 16px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2.5rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.stimulus-text {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    transition: transform 0.1s ease;
}

/* Shape representation */
.shape {
    width: 110px;
    height: 110px;
    display: inline-block;
    transition: transform 0.1s ease;
}

.shape.daire {
    border-radius: 50%;
}

.shape.üçgen {
    width: 0;
    height: 0;
    border-left: 55px solid transparent;
    border-right: 55px solid transparent;
    background-color: transparent !important;
}

/* CSS-only shapes color mapping */
.shape.red { background-color: var(--color-red); }
.shape.blue { background-color: var(--color-blue); }
.shape.green { background-color: var(--color-green); }
.shape.yellow { background-color: var(--color-yellow); }

.shape.üçgen.red { border-bottom: 110px solid var(--color-red); }
.shape.üçgen.blue { border-bottom: 110px solid var(--color-blue); }
.shape.üçgen.green { border-bottom: 110px solid var(--color-green); }
.shape.üçgen.yellow { border-bottom: 110px solid var(--color-yellow); }

.shape.kare {
    border-radius: 8px;
}

/* Star Shape */
.shape.yıldız {
   position: relative;
   display: inline-block;
   color: red;
   width: 0px;
   height: 0px;
   border-right:  100px solid transparent;
   border-bottom: 70px  solid red;
   border-left:   100px solid transparent;
   transform: rotate(35deg) scale(0.6);
   background-color: transparent !important;
}
.shape.yıldız:before {
   border-bottom: 80px solid red;
   border-left: 30px solid transparent;
   border-right: 30px solid transparent;
   position: absolute;
   height: 0;
   width: 0;
   top: -45px;
   left: -65px;
   display: block;
   content: '';
   transform: rotate(-35deg);
}
.shape.yıldız:after {
   position: absolute;
   display: block;
   color: red;
   top: 3px;
   left: -105px;
   width: 0px;
   height: 0px;
   border-right: 100px solid transparent;
   border-bottom: 70px solid red;
   border-left: 100px solid transparent;
   transform: rotate(-70deg);
   content: '';
}

.shape.yıldız.red { border-bottom-color: var(--color-red); }
.shape.yıldız.red:before { border-bottom-color: var(--color-red); }
.shape.yıldız.red:after { border-bottom-color: var(--color-red); }

.shape.yıldız.blue { border-bottom-color: var(--color-blue); }
.shape.yıldız.blue:before { border-bottom-color: var(--color-blue); }
.shape.yıldız.blue:after { border-bottom-color: var(--color-blue); }

.shape.yıldız.green { border-bottom-color: var(--color-green); }
.shape.yıldız.green:before { border-bottom-color: var(--color-green); }
.shape.yıldız.green:after { border-bottom-color: var(--color-green); }

.shape.yıldız.yellow { border-bottom-color: var(--color-yellow); }
.shape.yıldız.yellow:before { border-bottom-color: var(--color-yellow); }
.shape.yıldız.yellow:after { border-bottom-color: var(--color-yellow); }

/* Heart Shape */
.shape.kalp {
    position: relative;
    width: 100px;
    height: 90px;
    transform: scale(0.9);
    background-color: transparent !important;
}
.shape.kalp:before,
.shape.kalp:after {
    position: absolute;
    content: "";
    left: 50px;
    top: 0;
    width: 50px;
    height: 80px;
    background: red;
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}
.shape.kalp:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.shape.kalp.red:before, .shape.kalp.red:after { background: var(--color-red); }
.shape.kalp.blue:before, .shape.kalp.blue:after { background: var(--color-blue); }
.shape.kalp.green:before, .shape.kalp.green:after { background: var(--color-green); }
.shape.kalp.yellow:before, .shape.kalp.yellow:after { background: var(--color-yellow); }


/* Color options buttons panel */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-btn {
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    color: white;
    transition: transform 0.1s ease, filter 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.option-btn.practice-correct-highlight {
    outline: 3px solid #10b981;
    outline-offset: 2px;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
    animation: correct-pulse 1.5s infinite;
}

@keyframes correct-pulse {
    0% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }
    50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.9); }
    100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.6); }
}

.option-btn:active {
    transform: scale(0.95);
}

.option-btn:hover {
    filter: brightness(1.1);
}

.option-btn.selected-active {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    outline: 4px solid #ffffff;
    outline-offset: 2px;
    z-index: 10;
}

.option-btn.red { background-color: var(--color-red); }
.option-btn.blue { background-color: var(--color-blue); }
.option-btn.green { background-color: var(--color-green); }
.option-btn.yellow { background-color: var(--color-yellow); color: #1e293b; }

/* Admin Dashboard Layout */
.admin-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Charts Wrapper */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Custom Checkbox for shape config */
.shape-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shape-item {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.shape-item:hover {
    background: rgba(15, 23, 42, 0.7);
}

.shape-item input {
    margin-right: 1rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: #6366f1;
}

/* Table styling */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Footer */
footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Audio Visualizer Wave and Countdown Animations */
@keyframes pulse-countdown {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; color: #a855f7; }
    100% { transform: scale(1); opacity: 0.8; }
}

.mic-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
}

.mic-wave span {
    display: inline-block;
    width: 5px;
    height: 10px;
    background: linear-gradient(180deg, #a855f7 0%, #6366f1 100%);
    border-radius: 3px;
    animation: mic-bounce 0.8s infinite ease-in-out;
}

.mic-wave span:nth-child(1) {
    animation-delay: 0s;
    height: 12px;
}

.mic-wave span:nth-child(2) {
    animation-delay: 0.15s;
    height: 24px;
}

.mic-wave span:nth-child(3) {
    animation-delay: 0.3s;
    height: 15px;
}

@keyframes mic-bounce {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(2.4); }
}

/* Immersive Fullscreen Focus Mode for gameplay */
body.game-active-mode {
    overflow: hidden;
}

body.game-active-mode header,
body.game-active-mode footer {
    display: none !important;
}

body.game-active-mode main {
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.game-active-mode #game-card {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    background: #f8fafc; /* match canvas white background for seamless 100% cover */
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* Float progress bar at the top of the fullscreen white viewport */
body.game-active-mode .progress-container {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    z-index: 100;
    margin: 0;
}

/* Make stimulus display canvas occupy 100% of viewport */
body.game-active-mode .stimulus-canvas {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background-color: #f8fafc;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.game-active-mode .stimulus-text {
    font-size: 6.5rem; /* even larger text for full screen */
}

body.game-active-mode .shape {
    width: 220px; /* larger shape size in full screen */
    height: 220px;
}

body.game-active-mode .shape.üçgen {
    border-left: 110px solid transparent;
    border-right: 110px solid transparent;
    border-bottom: 0px solid transparent;
}
body.game-active-mode .shape.üçgen.red { border-bottom: 220px solid var(--color-red); }
body.game-active-mode .shape.üçgen.blue { border-bottom: 220px solid var(--color-blue); }
body.game-active-mode .shape.üçgen.green { border-bottom: 220px solid var(--color-green); }
body.game-active-mode .shape.üçgen.yellow { border-bottom: 220px solid var(--color-yellow); }

body.game-active-mode .shape.yıldız {
    transform: rotate(35deg) scale(1.3);
}

body.game-active-mode .options-grid {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    z-index: 100;
}

/* Nest voice indicator and help text relative to the canvas bottom */
.stimulus-canvas #voice-indicator {
    position: absolute;
    bottom: 4rem; /* printed on top of the canvas, lower down */
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    z-index: 10;
}

body.game-active-mode #voice-help-text {
    position: absolute;
    bottom: 1.5rem; /* slightly below the voice-indicator */
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
    z-index: 10;
}

/* Hide options buttons entirely when in voice mode */
body.voice-mode-active .options-grid {
    display: none !important;
}
