/* WooCOD Public Styles - Optimized for performance */

:root {
    --woocod-primary: #108060;
    --woocod-primary-hover: #0d664d;
    --woocod-white: #ffffff;
    --woocod-black: #000000;
    --woocod-border: #e1e3e5;
    --woocod-bg: #f6f6f7;
    --woocod-text: #202223;
    --woocod-text-muted: #6d7175;
}

/* Hidden by default */
.woocod-hidden {
    display: none !important;
}

/* Body lock */
body.woocod-lock {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Popup Overlay */
#woocod-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#woocod-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup Styles */
#woocod-popup-container {
    background: var(--woocod-bg-color, #ffffff);
    color: var(--woocod-text-color, #1a1c1d);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    border-radius: var(--woocod-border-radius, 8px);
    position: relative;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#woocod-popup-overlay.active #woocod-popup-container {
    transform: translateY(0);
}

/* Flyout Styles */
#woocod-popup-overlay.left-flyout {
    justify-content: flex-start;
    padding: 0;
}

#woocod-popup-overlay.left-flyout #woocod-popup-container {
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    transform: translateX(-100%);
}

#woocod-popup-overlay.left-flyout.active #woocod-popup-container {
    transform: translateX(0);
}

#woocod-popup-overlay.right-flyout {
    justify-content: flex-end;
    padding: 0;
}

#woocod-popup-overlay.right-flyout #woocod-popup-container {
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    transform: translateX(100%);
}

#woocod-popup-overlay.right-flyout.active #woocod-popup-container {
    transform: translateX(0);
}

/* Mobile Fullscreen */
@media (max-width: 768px) {
    #woocod-popup-overlay.mobile-fullscreen {
        padding: 0;
    }

    #woocod-popup-overlay.mobile-fullscreen #woocod-popup-container {
        max-height: 100vh;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
    }
}

/* Direct Embed */
.woocod-direct-embed {
    background: var(--woocod-bg-color, #ffffff);
    color: var(--woocod-text-color, #1a1c1d);
    border-radius: var(--woocod-border-radius, 8px);
    border: 1px solid var(--woocod-border-color, #e5e7eb);
    margin: 20px 0;
}

/* RTL Support */
#woocod-popup-overlay.rtl {
    direction: rtl;
    text-align: right;
}

/* Close Button */
#woocod-close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--woocod-text-color, #666);
    line-height: 1;
    z-index: 10;
}

#woocod-popup-overlay.rtl #woocod-close-popup {
    right: auto;
    left: 15px;
}

/* Form Styles */
#woocod-form-wrapper {
    padding: 24px;
}

.woocod-form-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: inherit;
}

.woocod-form-desc {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 24px;
}

.preview-field {
    margin-bottom: 16px;
}

.preview-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: inherit;
}

.preview-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--woocod-border-color, #ddd);
    border-radius: var(--woocod-border-radius, 8px);
    font-size: 14px;
    background: #fff;
    color: #1a1c1d;
    transition: border-color 0.2s;
}

.preview-input:focus {
    border-color: var(--woocod-primary-color);
    outline: none;
}

.buy-button {
    width: 100%;
    padding: 14px;
    background: var(--woocod-primary-color, #22c55e);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    margin-top: 20px;
    transition: opacity 0.2s;
}

.buy-button:hover {
    opacity: 0.9;
}

/* Scrollbar */
#woocod-popup-container::-webkit-scrollbar {
    width: 6px;
}

#woocod-popup-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}