/* ===========================
   Flappy Shark - Main Styles
   =========================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(180deg, #1a5490 0%, #0d2d4d 100%);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Game Container */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    max-height: 675px;
    margin: 0 auto;
}

/* Canvas */
#gameCanvas {
    display: block;
    background: linear-gradient(180deg, #4a9fd8 0%, #1a5490 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a5490 0%, #0d2d4d 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#loading-screen.loaded {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-content h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #7dc8f0;
}

.loading-bar {
    width: 300px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a9fd8, #7dc8f0);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

#loading-text {
    font-size: 1em;
    color: #b0d4f1;
}

/* Screens and Overlays */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    display: none;
    opacity: 0;
}

/* Menu Screen */
#menu-screen {
    background: rgba(13, 45, 77, 0.95);
}

.menu-content {
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

.game-title {
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    color: #7dc8f0;
    letter-spacing: 2px;
}

.shark-preview {
    width: 120px;
    height: 90px;
    margin: 0 auto 30px;
    background: url('../assets/images/shark/shark-1.png') no-repeat center;
    background-size: contain;
    animation: float 2s ease-in-out infinite;
}

.best-score-display {
    font-size: 1.5em;
    margin-top: 20px;
    color: #b0d4f1;
}

.menu-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Game Over Screen */
.gameover-content {
    text-align: center;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.gameover-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #ff6b9d;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    animation: shake 0.5s ease;
}

.score-display {
    font-size: 1.5em;
    margin-bottom: 30px;
    line-height: 1.8;
}

.score-display p {
    margin: 10px 0;
}

.score-display span {
    font-weight: bold;
    color: #7dc8f0;
}

/* Pause Screen */
.pause-content {
    text-align: center;
    animation: fadeInScale 0.3s ease-out;
}

.pause-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #7dc8f0;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

#hud.hidden {
    display: none;
}

#hud > * {
    pointer-events: auto;
}

.hud-score {
    font-size: 2em;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hud-buttons {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #4a9fd8, #7dc8f0);
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5ab0e8, #8dd8ff);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #8a9199);
    color: #ffffff;
    margin-top: 15px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7c858d, #9aa1a9);
}

.btn-icon {
    width: 50px;
    height: 50px;
    padding: 10px;
    font-size: 1.5em;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tutorial Overlay */
#tutorial-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    pointer-events: none;
}

#tutorial-overlay.hidden {
    display: none;
}

.tutorial-content {
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

.tutorial-text {
    font-size: 2em;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
}

.tutorial-hand {
    font-size: 3em;
    animation: bounce 1s ease-in-out infinite;
}

/* Instructions Modal */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(180deg, #1a5490, #0d2d4d);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(125, 200, 240, 0.3);
}

.modal-content h3 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #7dc8f0;
}

.modal-content ul {
    text-align: left;
    list-style: none;
    margin-bottom: 30px;
    font-size: 1.1em;
    line-height: 2;
}

.modal-content ul li:before {
    content: "🦈 ";
    margin-right: 10px;
}

/* Rotate Prompt */
#rotate-prompt {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a5490, #0d2d4d);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

#rotate-prompt.hidden {
    display: none !important;
}

.rotate-content {
    text-align: center;
    padding: 40px;
}

.rotate-icon {
    font-size: 4em;
    margin-bottom: 30px;
    animation: rotate 2s linear infinite;
}

.rotate-content p {
    font-size: 1.5em;
    color: #b0d4f1;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

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

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Focus styles for accessibility */
button:focus {
    outline: 3px solid #7dc8f0;
    outline-offset: 3px;
}
