.apb-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(90, 74, 58, 0.8);
    z-index: 999999;
    display: none;
    backdrop-filter: blur(2px);
}

.apb-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    z-index: 1000000;
}

.apb-popup-content {
    background: linear-gradient(135deg, #f8f4f0 0%, #ffffff 100%);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 20px 40px rgba(90, 74, 58, 0.3);
    border: 3px solid #e6a85c;
    animation: popupSlideIn 0.4s ease-out;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.apb-popup-content.apb-clickable {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.apb-popup-content.apb-clickable:hover {
    transform: scale(1.02);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.apb-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #e6a85c;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(90, 74, 58, 0.3);
}

.apb-close-btn:hover {
    background: #d89441;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(90, 74, 58, 0.4);
}

.apb-popup-body {
    padding: 30px;
    color: #5a4a3a;
    line-height: 1.6;
    font-size: 16px;
    overflow-y: auto;
    flex: 1;

    /* Peidame kerimisriba kõigis brauserites */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Webkit brauserid (Chrome, Safari, Edge) */
.apb-popup-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
    display: none;
}

.apb-popup-body::-webkit-scrollbar-track {
    background: transparent;
    display: none;
}

.apb-popup-body::-webkit-scrollbar-thumb {
    background: transparent;
    display: none;
}

.apb-popup-body h1,
.apb-popup-body h2,
.apb-popup-body h3,
.apb-popup-body h4,
.apb-popup-body h5,
.apb-popup-body h6 {
    color: #5a4a3a;
    margin-top: 0;
    margin-bottom: 15px;
}

.apb-popup-body h1 {
    font-size: 28px;
    border-bottom: 3px solid #e6a85c;
    padding-bottom: 10px;
}

.apb-popup-body h2 {
    font-size: 24px;
    color: #e6a85c;
}

.apb-popup-body p {
    margin-bottom: 15px;
}

.apb-popup-body a {
    color: #e6a85c;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.apb-popup-body a:hover {
    color: #d89441;
    text-decoration: underline;
}

/* Nupu konteiner */
.apb-button-container {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e6a85c;
    flex-shrink: 0;
}

.apb-button {
    display: inline-block;
    background: linear-gradient(45deg, #e6a85c, #d89441);
    color: white !important;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(230, 168, 92, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.apb-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #d89441, #cc8635);
    transition: left 0.3s ease;
    z-index: -1;
}

.apb-button:hover {
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 168, 92, 0.4);
}

.apb-button:hover:before {
    left: 0;
}

.apb-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(230, 168, 92, 0.3);
}

/* Üldised elemendid */
.apb-popup-body ul,
.apb-popup-body ol {
    padding-left: 25px;
    margin-bottom: 15px;
}

.apb-popup-body li {
    margin-bottom: 8px;
}

.apb-popup-body blockquote {
    background: #f8f4f0;
    border-left: 4px solid #e6a85c;
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.apb-popup-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(90, 74, 58, 0.2);
}

/* Responsive disain */
@media (max-width: 768px) {
    .apb-popup-container {
        width: 95%;
        max-height: 90vh;
    }

    .apb-popup-content {
        max-height: 90vh;
    }

    .apb-popup-body {
        padding: 20px;
        font-size: 14px;
    }

    .apb-popup-body h1 {
        font-size: 22px;
    }

    .apb-popup-body h2 {
        font-size: 18px;
    }

    .apb-close-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
        top: 10px;
        right: 15px;
    }

    .apb-button {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .apb-popup-body {
        padding: 15px;
    }

    .apb-popup-body h1 {
        font-size: 20px;
    }

    .apb-close-btn {
        width: 25px;
        height: 25px;
        font-size: 14px;
        top: 8px;
        right: 12px;
    }

    .apb-button {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Üldise lingi indikaator */
.apb-clickable {
    position: relative;
}

.apb-clickable:after {
    content: '🔗';
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 12px;
    opacity: 0.6;
    z-index: 5;
}
