/* Popup styles - Old Windows style */
.popup-container {
    position: fixed;
    z-index: 10002;
    width: 100%;
    height: 100%;
    pointer-events: none;
    top: 0;
    left: 0;
}

.popup {
    position: absolute;
    background: var(--accent-color, #ff0000); /* Use accent color with fallback */
    border-radius: 0;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: all 0.3s ease;
    pointer-events: auto;
    animation: popIn 0.5s ease-out;
    border: 2px solid var(--accent-color, #ff0000);
    min-width: 150px; /* Increased minimum size */
    min-height: 100px; /* Increased minimum size */
    z-index: 10003;
}

/* Title bar using accent color */
.popup::before {
    content: "Reklama";
    display: block;
    background: linear-gradient(to bottom, 
                var(--accent-color-light, rgba(255, 0, 0, 0.8)) 0%, 
                var(--accent-color-light, rgba(255, 0, 0, 0.8)) 5%, 
                var(--accent-color, #ff0000) 5%, 
                var(--accent-color, #ff0000) 100%);
    color: white;
    font-weight: bold;
    padding: 5px 10px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    text-align: left;
    height: 25px;
    line-height: 25px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.popup-content {
    overflow: hidden;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.popup-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Close button using accent color - made larger */
.close-popup {
    position: absolute;
    top: 0;
    right: 0;
    width: 25px;
    height: 25px;
    background: linear-gradient(to bottom, 
                var(--accent-color-dark, #cc0000) 0%, 
                var(--accent-color, #ff0000) 45%, 
                var(--accent-color, #ff0000) 50%, 
                var(--accent-color-dark, #cc0000) 55%, 
                var(--accent-color-darker, #990000) 100%);
    color: white;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    line-height: 25px;
    cursor: pointer;
    z-index: 10004;
    border-left: 1px solid var(--accent-color, #ff0000);
    border-bottom: 1px solid var(--accent-color, #ff0000);
    box-shadow: -1px 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.close-popup::before {
    content: "×";
    display: block;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}

.close-popup:hover {
    background: linear-gradient(to bottom, 
                var(--accent-color-light, rgba(255, 0, 0, 0.8)) 0%, 
                var(--accent-color, #ff0000) 45%, 
                var(--accent-color, #ff0000) 50%, 
                var(--accent-color, #ff0000) 55%, 
                var(--accent-color-dark, #cc0000) 100%);
}

.close-popup:active {
    background: linear-gradient(to bottom, 
                var(--accent-color-dark, #cc0000) 0%, 
                var(--accent-color-dark, #cc0000) 45%, 
                var(--accent-color-darker, #990000) 50%, 
                var(--accent-color-darker, #990000) 100%);
}

/* Resize handle using accent color */
.popup::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, transparent 50%, var(--accent-color, #ff0000) 50%);
    cursor: nwse-resize;
}

.popup-header {
    background: linear-gradient(to right, #000080, #1084d0);
    padding: 5px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.popup-title {
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
}

.popup-close {
    width: 16px;
    height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #c0c0c0;
    border: 1px outset #fff;
    cursor: pointer;
    font-weight: bold;
    font-size: 10px;
    line-height: 1;
}

.popup-close:hover {
    background-color: #e1e1e1;
}

.popup-close:active {
    border: 1px inset #fff;
}

.popup-ad-image {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    display: block;
    margin-bottom: 10px;
    border: 1px inset #808080;
}

.popup-cta {
    display: block;
    width: 100%;
    padding: 5px;
    background-color: #c0c0c0;
    color: black;
    border: 2px outset #fff;
    margin-top: 15px;
    text-align: center;
    cursor: pointer;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 0.9rem;
}

.popup-cta:hover {
    background-color: #e1e1e1;
}

.popup-cta:active {
    border: 2px inset #fff;
    background-color: #c0c0c0;
}

/* Classic win98 buttons */
.btn-win98 {
    background-color: #c0c0c0;
    border: 2px outset #fff;
    padding: 3px 8px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 0.9rem;
    color: black;
    cursor: pointer;
    margin-right: 5px;
}

.btn-win98:hover {
    background-color: #e1e1e1;
}

.btn-win98:active {
    border: 2px inset #fff;
}

/* Popup animation */
@keyframes windowsOpen {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.popup {
    animation: windowsOpen 0.2s ease-out forwards;
}

/* Extra win98 styles for authenticity */
.win98-footer {
    border-top: 1px solid #808080;
    margin-top: 10px;
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.win98-statusbar {
    display: flex;
    border-top: 1px solid #808080;
    padding: 3px 5px;
    font-size: 0.8rem;
    margin-top: 10px;
    background-color: #c0c0c0;
}

.win98-statusbar-item {
    border: 1px inset #fff;
    padding: 1px 5px;
    flex-grow: 1;
}

/* Win98 progress bar */
.win98-progress {
    height: 15px;
    border: 1px inset #fff;
    background-color: #fff;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}

.win98-progress-bar {
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #2b8fff,
        #2b8fff 10px,
        #0078d7 10px,
        #0078d7 20px
    );
    width: 50%;
    animation: progressAnim 3s linear infinite;
}

@keyframes progressAnim {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}