/* Demo button to open popup */
.demo-button {
    background: #4CAF50;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.demo-button:hover {
    filter: sepia(1) saturate(2) hue-rotate(165deg);
}

/* Overlay */
.autoplay-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.autoplay-popup-overlay.active {
    display: block;
}

/* Main popup container */
.autoplay-popup {
    display: none;
    position: fixed;
    background: white;
    border: none;
    border-top: solid 6px #373737;
    border-right: solid 6px #3a3a3a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background-image: linear-gradient(#0000004f, #0000004f), url(./../assets/blocks/block-dirt-top.png);
    background-size: 100px 100px;
    image-rendering: pixelated;
    z-index: 9999;
    animation: slideUp 0.3s
    ease;
}

.autoplay-popup-content {
    overflow-y: auto;
    padding: 25px 25px;

}

.autoplay-popup.active {
    display: flex;
    flex-direction: column;
}

/* Desktop styles */
@media (min-width: 769px) {
    .autoplay-popup {
        width: 480px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-height: 100%;
        overflow-y: auto;
        box-sizing: border-box;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .autoplay-popup {
        width: 90%;
        max-width: 400px;
        top: 0;
        width: 100%;
        box-sizing: border-box;
        overflow: auto;
        height: 100%;
        border-radius: 0;
        max-width: 100%;
        animation: slideUpMobile 0.3s ease;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .autoplay-popup {
        width: 100%;
        overflow-y: auto;
        animation: slideUpMobile 0.3s ease;
    }
}

/* Popup header */
.autoplay-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-image: linear-gradient(#0000004f, #0000004f), url(./../assets/blocks/block-stone.png);
    background-size: 100px 100px;
    image-rendering: pixelated;
    padding: 0px 25px;
    border-bottom: solid 1px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 900;
    text-shadow: 2px 2px 0 black;
}

.autoplay-popup-title {
    font-size: 30px;
    letter-spacing: 0.5px;
    font-family: "Jersey 10", system-ui, serif !important;
    color: white;
    margin: .5em 0px;
    font-weight: 400 !important;
}

.autoplay-popup-close {
    background: #707070;
    border: solid 4px;
    border-top-color: #aaaaaa;
    border-left-color: #aaaaaa;
    border-bottom-color: #565656;
    border-right-color: #565656;
    outline: solid 3px black;
    color: white;
    height: 40px;
    text-shadow: black 2px 2px 0;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}



.autoplay-popup-close:hover {
    background: #811818;
    border-top-color: #d27878;
    border-bottom-color: #600505;
    border-right-color: #600505;
    border-left-color: #d27878;
}

/* Section styles */
.autoplay-popup-section {
    margin-bottom: 25px;
}

.autoplay-popup-label {
    color: #000000;
    text-shadow: 1px 1px 0 #ffffff70;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: block;
}

/* Number selector buttons */
.autoplay-popup-numbers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.autoplay-popup-number {
    flex: 1;
    min-width: 60px;
    border: solid 4px;
    border-top-color: #aaaaaa;
    border-left-color: #aaaaaa;
    border-bottom-color: #565656;
    border-right-color: #565656;
    outline: solid 3px black;
    background: #787878;
    color: white;
    font-size: 24px;
    font-weight: 400;
    text-shadow: 2px 2px 0 BLACK;
    cursor: pointer;
}

.autoplay-popup-number:hover:not(.disabled) {
    filter: sepia(1) saturate(2) hue-rotate(165deg);
}

.autoplay-popup-number.selected {
    background: #188118;
    border-top-color: #78d278;
    border-bottom-color: #056005;
    border-right-color: #056005;
    border-left-color: #78d278;
}

/* Strategy buttons */
.autoplay-popup-strategies {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (max-width: 480px) {
    .autoplay-popup-strategies {
        grid-template-columns: 1fr;
    }
}

.autoplay-popup-strategy {
    border: solid 4px;
    border-top-color: #aaaaaa;
    border-left-color: #aaaaaa;
    border-bottom-color: #565656;
    border-right-color: #565656;
    outline: solid 3px black;
    background: #787878;
    color: white;
    font-size: 16px;
    font-weight: 400;
    text-shadow: 2px 2px 0 BLACK;
    cursor: pointer;
}

.autoplay-popup-strategy:hover:not(.disabled) {
    filter: sepia(1) saturate(2) hue-rotate(165deg);
}

.autoplay-popup-strategy.selected {
    background: #188118;
    border-top-color: #78d278;
    border-bottom-color: #056005;
    border-right-color: #056005;
    border-left-color: #78d278;
}

/* Action buttons */
.autoplay-popup-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.autoplay-popup-button {
    flex: 1;
    border: solid 4px;
    border-top-color: #aaaaaa;
    border-left-color: #aaaaaa;
    border-bottom-color: #565656;
    border-right-color: #565656;
    outline: solid 3px black;
    background: #787878;
    color: white;
    font-size: 20px;
    font-weight: 400;
    padding: 10px 0;
    text-shadow: 2px 2px 0 BLACK;
    cursor: pointer;
}

.autoplay-popup-button.primary {
    background: #188118;
    border-top-color: #78d278;
    border-bottom-color: #056005;
    border-right-color: #056005;
    border-left-color: #78d278;
}

.autoplay-popup-button.primary:hover:not(.disabled) {
    filter: sepia(1) saturate(2) hue-rotate(165deg);
}

.autoplay-popup-button.stop {
    background: #811818;
    border-top-color: #d27878;
    border-bottom-color: #600505;
    border-right-color: #600505;
    border-left-color: #d27878;
}

.autoplay-popup-button.stop:hover:not(.disabled) {
    filter: sepia(1) saturate(2) hue-rotate(165deg);
}

/* Disabled state */
.disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideUpMobile {
    from {
        opacity: 0;
        transform: translate(0, 10%);
    }
    to {
        opacity: 1;
        transform: translate(0, 0);
    }
}

/* Status display */
.autoplay-status {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: #b0b0c0;
    text-align: center;
    font-size: 14px;
}

.autoplay-status.active {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.autoplay-popup.active * {
    font-family: system-ui;
    font-weight: bold;
}