/*
 * This file is part of the Tetris Game project.
 * 
 * License: This code is free to use and modify, but you must provide recognition to the original developer.
 * Author: CTechDigital.com
 */

/* Game and layout styles */
#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0px;
    margin-left: 270px; 
    padding: 5px;
    transition: margin-left 0.3s ease;
    position: relative; 
}

#tetris-board {
    border: 2px solid #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    background-color: #121212;
}

#score-container {
    margin-top: 10px;
    font-size: 1.2rem;
    color: #333;
    text-align: center;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#game-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

#game-controls button {
    padding: 8px 15px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #000;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    transition: background-color 0.3s;
}

#game-controls button:hover {
    background-color: #45a049;
}

#game-controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #cccccc;
}

/* Base styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-image: url('../assets/images/background/background-image.webp');
    background-size: cover;
    background-position: center;
    position: relative;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(222, 218, 218, 0.582);
    z-index: -1;
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background-color: #333;
    padding: 15% 20px 20px 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    text-align: center;
    color: white;
    transition: width 0.3s ease;
}

.sidebar-logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 100%;
}

.sidebar-created-by {
    font-size: 14px;
    margin-bottom: 5px;
}

.sidebar-url {
    font-size: 14px;
    color: #4CAF50;
    text-decoration: none;
    margin-bottom: 15px;
    display: block;
}

.sidebar-url:hover {
    text-decoration: underline;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.social-icon {
    height: 24px;
    width: auto;
}

.sidebar-description {
    font-size: 14px;
    margin-bottom: 15px;
}

.sidebar-help-notice {
    font-size: 12px;
    margin-bottom: 15px;
    color: #ffd700;
}

.donate-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

#donate-btn-patreon, 
#donate-btn-paypal, 
#donate-btn-kofi {
    --border-width: 1px;
    --border-cut: 12px;
    --button-shape: polygon(var(--border-cut) 0, 100% 0, 100% calc(100% - var(--border-cut)), calc(100% - var(--border-cut)) 100%, 0 100%, 0 var(--border-cut));
    background-color: #4CAF50;
    color: white;
    border: var(--border-width) solid rgb(66, 64, 64);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
    clip-path: var(--button-shape);
    -webkit-clip-path: var(--button-shape);
}

.btn-flash {
    animation: button-flash 1s infinite alternate;
    position: relative;
    z-index: 5;
}

@keyframes button-flash {
    0% {
        box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.7), 0 0 30px 10px rgba(255, 215, 0, 0.3);
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 25px 10px rgba(255, 255, 255, 0.9), 0 0 40px 15px rgba(255, 215, 0, 0.5);
        transform: scale(1.08);
        filter: brightness(1.3) contrast(1.1);
    }
    100% {
        box-shadow: 0 0 20px 8px rgba(255, 255, 255, 0.8), 0 0 35px 12px rgba(255, 215, 0, 0.4);
        transform: scale(1.05) rotate(1deg);
        filter: brightness(1.2);
    }
}

#donate-btn-patreon.btn-flash {
    box-shadow: 0 0 20px 10px rgba(249, 104, 84, 0.7) !important;
}

#donate-btn-paypal.btn-flash {
    box-shadow: 0 0 20px 10px rgba(0, 112, 186, 0.7) !important;
}

#donate-btn-kofi.btn-flash {
    box-shadow: 0 0 20px 10px rgba(255, 224, 0, 0.7) !important;
}


#toggle-sidebar-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

#toggle-sidebar-btn:hover {
    background-color: #45a049;
}


.hidden {
    display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    #sidebar {
        width: 200px; 
    }

    #game-container {
        margin-left: 210px; 
    }

    .social-icons {
        flex-wrap: wrap; 
        gap: 5px;
    }

    .donate-buttons {
        gap: 5px;
    }

    #donate-btn-patreon, #donate-btn-paypal, #donate-btn-kofi {
        font-size: 12px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    #sidebar {
        width: 150px; 
        padding: 15px;
    }

    #game-container {
        margin-left: 160px; 
    }

    .sidebar-logo {
        margin-bottom: 10px;
    }

    .sidebar-description {
        font-size: 12px;
    }

    .social-icons {
        gap: 3px;
    }

    #donate-btn-patreon, #donate-btn-paypal, #donate-btn-kofi {
        font-size: 10px;
        padding: 5px 8px;
    }
}


#canvas-size-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.size-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.size-input-group label {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.size-input-group input {
    width: 70px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
}

#apply-size-btn {
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

#apply-size-btn:hover {
    background-color: #45a049;
}

#scores-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border-left: 2px solid #333;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#scores-container h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

#top-scores-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    color: #333;
}

#top-scores-list li {
    margin-bottom: 5px;
}
