/* Blok Kodlama Sayfası */

.main-blok {
    max-width: 1100px;
}

/* Oyun Türü Sekmeleri */
.game-type-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.game-type-tab {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.game-type-tab:hover {
    background: #eef2ff;
}

.game-type-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

/* Seviye Seçici */
.level-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.level-selector select {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--primary);
    border-radius: 12px;
    background: white;
    cursor: pointer;
}

.btn-hint {
    font-size: 1.25rem;
    padding: 0.4rem 0.6rem;
    background: #fef3c7;
    border: 2px solid var(--secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-hint:hover {
    background: #fde68a;
    transform: scale(1.1);
}

.blok-layout {
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    gap: 1rem;
    padding: 1rem;
}

@media (max-width: 900px) {
    .blok-layout {
        grid-template-columns: 1fr;
    }
}

/* Blok Paleti */
.block-palette {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    height: fit-content;
}

.block-palette h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.palette-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.block-templates {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.block-template {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    cursor: grab;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.block-template:hover {
    background: #eef2ff;
    transform: scale(1.02);
}

.block-template:active {
    cursor: grabbing;
}

.block-template.dragging {
    opacity: 0.5;
}

.block-emoji {
    font-size: 1.2rem;
}

.block-template[data-type="ileri"] { border-color: #10b981; background: #ecfdf5; }
.block-template[data-type="geri"] { border-color: #ef4444; background: #fef2f2; }
.block-template[data-type="saga"] { border-color: #f59e0b; background: #fffbeb; }
.block-template[data-type="sola"] { border-color: #6366f1; background: #eef2ff; }
.block-template[data-type="tekrarla"] { border-color: #ec4899; background: #fdf2f8; }

.block-repeat {
    flex-wrap: wrap;
}

.repeat-input {
    width: 40px;
    padding: 0.2rem;
    border: 2px solid #ec4899;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

/* Program Alanı */
.program-area {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.program-area h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.program-container {
    min-height: 200px;
    padding: 1rem;
    background: #f8fafc;
    border: 3px dashed #cbd5e1;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.program-container.drag-over {
    background: #eef2ff;
    border-color: var(--primary);
}

.program-placeholder {
    color: var(--text-light);
    font-size: 0.95rem;
    text-align: center;
}

.program-placeholder.hidden {
    display: none;
}

.program-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    margin: 0.25rem 0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: grab;
    transition: all 0.2s;
}

.program-block:hover {
    transform: scale(1.01);
}

.program-block.dragging {
    opacity: 0.5;
}

.program-block[data-type="ileri"] { background: #d1fae5; border: 2px solid #10b981; }
.program-block[data-type="geri"] { background: #fee2e2; border: 2px solid #ef4444; }
.program-block[data-type="saga"] { background: #fef3c7; border: 2px solid #f59e0b; }
.program-block[data-type="sola"] { background: #e0e7ff; border: 2px solid #6366f1; }
.program-block[data-type="tekrarla"] {
    background: #fce7f3;
    border: 2px solid #ec4899;
    flex-direction: column;
    align-items: flex-start;
}

.repeat-slots {
    min-height: 40px;
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: rgba(236, 72, 153, 0.1);
    border: 2px dashed #ec4899;
    border-radius: 10px;
}

.repeat-slots.drag-over {
    background: rgba(236, 72, 153, 0.2);
}

.slot-hint {
    font-size: 0.8rem;
    color: var(--text-light);
}

.slot-hint.hidden {
    display: none;
}

.program-block .block-remove {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
}

.program-block .block-remove:hover {
    opacity: 1;
}

.program-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.speed-control label {
    font-size: 0.9rem;
    font-weight: 600;
}

.speed-control select {
    font-family: 'Nunito', sans-serif;
    padding: 0.3rem 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
}

.block-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.btn-run {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-run:hover {
    background: #059669;
    transform: scale(1.05);
}

.btn-run:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-clear {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    background: #f87171;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Oyun Alanı */
.game-area {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.game-area h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.game-goal {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.grid-container {
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 12px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 2px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.grid-cell {
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.grid-cell.robot {
    background: #e8f4fd;
}

.grid-cell.goal {
    background: #fef3c7;
}

.grid-cell.obstacle {
    background: #fecaca;
}

.grid-cell.visited {
    background: #d1fae5;
}

.grid-cell.collectible {
    background: #fce7f3;
}

.grid-cell.treasure {
    background: #fef3c7;
}

.game-stats {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-top: 0.5rem;
    min-height: 24px;
}

.grid-cell.active {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.game-feedback {
    min-height: 40px;
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}

.game-feedback.success {
    background: #d1fae5;
    color: #065f46;
}

.game-feedback.error {
    background: #fee2e2;
    color: #991b1b;
}

.game-feedback:empty {
    display: none;
}
