/* Genel reset ve temel stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Ana oyun konteyneri */
.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Arka plan */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('back.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}


/* Ana oyun alanı */
.game-area {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 50px 100px 50px;
    gap: 100px;
}

/* Anne hayvan bölümü */
.mother-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mother-container {
    position: relative;
    background: transparent;
    border-radius: 20px;
    padding: 30px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.mother-animal {
    width: 250px;
    height: 250px;
    object-fit: contain;
    border-radius: 15px;
    transition: all 0.3s ease;
}

/* Yavru hayvanlar bölümü */
.babies-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.babies-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 30px;
    padding: 20px;
}

.baby-slot {
    position: relative;
    background: transparent;
    border-radius: 15px;
    padding: 20px;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.25));
    transition: all 0.3s ease;
}

.baby-slot:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.baby-animal {
    width: 132px;
    height: 132px;
    object-fit: contain;
    border-radius: 10px;
    cursor: grab;
    transition: all 0.2s ease;
    will-change: transform, filter;
}

.baby-animal:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
}

.baby-animal:active {
    cursor: grabbing;
}

/* Sallanma animasyonu */
@keyframes sway {
    0%, 100% {
        transform: rotate(-2deg);
    }
    50% {
        transform: rotate(2deg);
    }
}

.sway {
    animation: sway 3s ease-in-out infinite;
}

/* Zıplama animasyonu */
@keyframes jump {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-20px) scale(1.1);
    }
    50% {
        transform: translateY(-30px) scale(1.15);
    }
    75% {
        transform: translateY(-15px) scale(1.05);
    }
}

.jump {
    animation: jump 0.8s ease-in-out 3;
}

/* Sürükleme sırasında - direkt element manipülasyonu */
.baby-animal.dragging-active {
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Smooth geri dönüş animasyonu */
.smooth-return {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Sürükleme hover efekti */
.drag-hover {
    transform: scale(1.1) !important;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4)) !important;
    z-index: 10000 !important;
}

/* Drop zone stilleri */
.drop-zone {
    border: 4px dashed #27ae60 !important;
    background: rgba(46, 204, 113, 0.2) !important;
    transform: scale(1.05);
}

.drop-zone-invalid {
    border: 4px dashed #e74c3c !important;
    background: rgba(231, 76, 60, 0.2) !important;
}

/* Modal stilleri */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    color: #27ae60;
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-content p {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 30px;
}

#next-level-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#next-level-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}


/* Responsive tasarım */
@media (max-width: 768px) {
    .game-title h1 {
        font-size: 2rem;
    }
    
    .game-area {
        flex-direction: column;
        padding: 20px;
        gap: 30px;
    }
    
    .mother-animal {
        width: 150px;
        height: 150px;
    }
    
    .baby-animal {
        width: 80px;
        height: 80px;
    }
    
    .babies-grid {
        gap: 15px;
    }
    
    .modal-content h2 {
        font-size: 2rem;
    }
    
    .modal-content p {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        padding: 15px;
    }
    
    .game-title h1 {
        font-size: 1.5rem;
    }
    
    .mother-animal {
        width: 120px;
        height: 120px;
    }
    
    .baby-animal {
        width: 60px;
        height: 60px;
    }
    
    .babies-grid {
        gap: 10px;
    }
    
    .baby-slot {
        padding: 10px;
    }
    
    .mother-container {
        padding: 20px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .baby-slot:hover {
        transform: none;
    }
    
    .baby-animal {
        cursor: default;
    }
    
    .baby-animal:active {
        cursor: default;
    }
}

/* Preload animasyonu */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Kalp animasyonları */
.heart {
    position: absolute;
    font-size: 20px;
    color: #e74c3c;
    pointer-events: none;
    z-index: 1000;
    animation: heartFloat 2s ease-out forwards;
}

.heart::before {
    content: '❤️';
}

.heart.pink {
    color: #ff69b4;
}

.heart.purple {
    color: #9b59b6;
}

.heart.red {
    color: #e74c3c;
}

.heart.orange {
    color: #f39c12;
}

/* Kalp yükseltme animasyonu */
@keyframes heartFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1) rotate(10deg);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-60px) scale(1.2) rotate(-5deg);
    }
    80% {
        opacity: 0.4;
        transform: translateY(-100px) scale(0.8) rotate(15deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-140px) scale(0.3) rotate(-10deg);
    }
}

/* Kalp patlaması animasyonu */
@keyframes heartBurst {
    0% {
        opacity: 1;
        transform: scale(0.3);
    }
    30% {
        opacity: 1;
        transform: scale(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
}

.heart.burst {
    animation: heartBurst 1.5s ease-out forwards;
}

/* Çıkış butonu */
.exit-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    z-index: 1500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.exit-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.exit-button:active {
    transform: translateY(0);
}

/* Hoş geldin modalı */
.welcome-content {
    max-width: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.welcome-content h2 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-content p {
    color: #f8f9fa;
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.instruction-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.instruction-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.ok-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ok-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Geri sayım overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    transition: opacity 0.5s ease;
}

.countdown-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.countdown-content {
    text-align: center;
    color: white;
}

.countdown-content h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.countdown-number {
    font-size: 8rem;
    font-weight: bold;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive tasarım güncellemeleri */
@media (max-width: 768px) {
    .exit-button {
        top: 15px;
        left: 15px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .welcome-content {
        max-width: 90%;
        padding: 30px;
    }
    
    .welcome-content h2 {
        font-size: 2rem;
    }
    
    .welcome-content p {
        font-size: 1rem;
    }
    
    .countdown-content h2 {
        font-size: 2rem;
    }
    
    .countdown-number {
        font-size: 5rem;
    }
}

@media (max-width: 480px) {
    .exit-button {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .welcome-content {
        padding: 20px;
    }
    
    .welcome-content h2 {
        font-size: 1.5rem;
    }
    
    .welcome-content p {
        font-size: 0.9rem;
    }
    
    .instruction-btn, .ok-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .countdown-content h2 {
        font-size: 1.5rem;
    }
    
    .countdown-number {
        font-size: 4rem;
    }
}

/* Çıkış onay modalı */
.exit-confirm-content {
    max-width: 450px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
}

.exit-confirm-content h2 {
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.exit-confirm-content p {
    color: #f8f9fa;
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.warning-text {
    color: #ffeb3b !important;
    font-weight: bold;
    font-size: 1rem !important;
    margin-bottom: 25px !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.exit-confirm-btn {
    background: #d32f2f;
    color: white;
    border: 2px solid #b71c1c;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 120px;
}

.exit-confirm-btn:hover {
    background: #b71c1c;
    border-color: #8d1414;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.exit-cancel-btn {
    background: #4caf50;
    color: white;
    border: 2px solid #388e3c;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 120px;
}

.exit-cancel-btn:hover {
    background: #388e3c;
    border-color: #2e7d32;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Responsive tasarım - çıkış modalı */
@media (max-width: 768px) {
    .exit-confirm-content {
        max-width: 90%;
        padding: 25px;
    }
    
    .exit-confirm-content h2 {
        font-size: 1.8rem;
    }
    
    .exit-confirm-content p {
        font-size: 1rem;
    }
    
    .modal-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .exit-confirm-btn, .exit-cancel-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .exit-confirm-content {
        padding: 20px;
    }
    
    .exit-confirm-content h2 {
        font-size: 1.5rem;
    }
    
    .exit-confirm-content p {
        font-size: 0.9rem;
    }
    
    .warning-text {
        font-size: 0.85rem !important;
    }
    
    .exit-confirm-btn, .exit-cancel-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
}
