/* Popup Manager Styles - Tapymas.lt Theme */

#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    display: none;
    background-color: rgba(0, 0, 0, 0.4);
}

#popup-container {
    position: fixed;
    z-index: 9999;
    padding: 0;
    box-shadow: 0 20px 60px rgba(79, 127, 255, 0.15);
    display: none;
    overflow: hidden;
    max-height: 90vh;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(79, 127, 255, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    width: auto;
    height: auto;
    min-width: var(--popup-min-width-desktop, 300px);
    max-width: 90vw;
}

/* Position classes */
#popup-container.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#popup-container.top-left {
    top: 20px;
    left: 20px;
}

#popup-container.top-right {
    top: 20px;
    right: 20px;
}

#popup-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

#popup-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

#popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#popup-close:hover {
    background: #ffffff;
    color: #4F7FFF;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 127, 255, 0.2);
}

/* Popup Header */
.popup-header {
    background: linear-gradient(135deg, #4F7FFF 0%, #6B8FFF 100%);
    padding: 24px 30px 20px;
    position: relative;
    overflow: hidden;
}

.popup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: rotate(45deg);
}

.popup-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

#popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Popup Content */
.popup-body {
    padding: 30px;
}

/* Popup Image Styles */
.popup-image {
    margin-bottom: 20px;
    text-align: center;
}

.popup-image img {
    max-width: var(--popup-image-max-width, 400px);
    width: auto;
    height: auto;
    max-height: var(--popup-image-max-height, 300px);
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.popup-image-top {
    order: -1;
    margin-bottom: 20px;
    margin-top: 0;
}

.popup-image-bottom {
    order: 1;
    margin-top: 20px;
    margin-bottom: 0;
}

.popup-image-left {
    float: left;
    margin-right: 20px;
    margin-bottom: 16px;
    max-width: 40%;
    text-align: left;
}

.popup-image-left img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: calc(var(--popup-image-max-height, 300px) * 0.7);
}

.popup-image-right {
    float: right;
    margin-left: 20px;
    margin-bottom: 16px;
    max-width: 40%;
    text-align: right;
}

.popup-image-right img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: calc(var(--popup-image-max-height, 300px) * 0.7);
}

/* Ensure proper layout for left/right positioned images */
.popup-body:has(.popup-image-left),
.popup-body:has(.popup-image-right) {
    display: block;
}

.popup-body:has(.popup-image-left) #popup-content,
.popup-body:has(.popup-image-right) #popup-content {
    overflow: hidden;
}

#popup-content {
    line-height: 1.6;
    color: #333333;
    font-size: 16px;
}

#popup-content p {
    margin: 0 0 16px 0;
    color: #555555;
}

#popup-content p:last-child {
    margin-bottom: 0;
}

#popup-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

#popup-content h1, #popup-content h2, #popup-content h3 {
    color: #4F7FFF;
    font-weight: 600;
    margin: 20px 0 12px 0;
}

#popup-content h1 { font-size: 28px; }
#popup-content h2 { font-size: 24px; }
#popup-content h3 { font-size: 20px; }

/* Buttons */
#popup-content .button,
#popup-content .btn,
#popup-content button[type="submit"],
#popup-content input[type="submit"] {
    background: linear-gradient(135deg, #4F7FFF 0%, #6B8FFF 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin: 8px 8px 8px 0;
    box-shadow: 0 4px 12px rgba(79, 127, 255, 0.3);
}

#popup-content .button:hover,
#popup-content .btn:hover,
#popup-content button[type="submit"]:hover,
#popup-content input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 127, 255, 0.4);
    background: linear-gradient(135deg, #3D6FEF 0%, #5B7FEF 100%);
}

/* Forms */
#popup-content input[type="text"],
#popup-content input[type="email"],
#popup-content input[type="tel"],
#popup-content textarea,
#popup-content select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 16px;
    font-family: inherit;
}

#popup-content input[type="text"]:focus,
#popup-content input[type="email"]:focus,
#popup-content input[type="tel"]:focus,
#popup-content textarea:focus,
#popup-content select:focus {
    outline: none;
    border-color: #4F7FFF;
    box-shadow: 0 0 0 3px rgba(79, 127, 255, 0.1);
}

/* Links */
#popup-content a {
    color: #4F7FFF;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

#popup-content a:hover {
    color: #3D6FEF;
    text-decoration: underline;
}

/* Lists */
#popup-content ul, #popup-content ol {
    padding-left: 20px;
    margin: 16px 0;
}

#popup-content li {
    margin-bottom: 8px;
    color: #555555;
}

/* Animation classes */
.popup-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-fade-out {
    animation: fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-slide-down-in {
    animation: slideDownIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-slide-down-out {
    animation: slideDownOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-slide-up-in {
    animation: slideUpIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-slide-up-out {
    animation: slideUpOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-zoom-in {
    animation: zoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-zoom-out {
    animation: zoomOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.popup-bounce-out {
    animation: bounceOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Keyframe animations */
@keyframes fadeIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOut {
    from { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

@keyframes slideDownIn {
    from {
        opacity: 0;
        transform: translate(-50%, -70%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideDownOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -30%);
    }
}

@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translate(-50%, -30%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes slideUpOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -70%);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
    70% {
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bounceOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    25% {
        transform: translate(-50%, -50%) scale(0.95);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
}

/* Special promotional styles (matching the banner) */
.popup-promo {
    background: linear-gradient(135deg, #4F7FFF 0%, #6B8FFF 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.popup-promo::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.popup-promo .popup-discount {
    font-size: 48px;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0;
    position: relative;
    z-index: 2;
}

.popup-promo .popup-subtitle {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0 0 0;
    position: relative;
    z-index: 2;
    opacity: 0.95;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #popup-container {
        width: 90% !important;
        max-width: 400px;
        height: auto !important;
        max-height: 85vh;
        margin: 20px;
        border-radius: 12px;
        min-width: var(--popup-min-width-mobile, 280px);
    }
    
    #popup-container.center {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    #popup-container.top-left,
    #popup-container.top-right {
        top: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    #popup-container.bottom-left,
    #popup-container.bottom-right {
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .popup-header {
        padding: 20px 24px 16px;
    }
    
    #popup-title {
        font-size: 20px;
    }
    
    .popup-body {
        padding: 24px;
    }
    
    #popup-content {
        font-size: 15px;
    }
    
    .popup-promo .popup-discount {
        font-size: 36px;
    }
    
    .popup-promo .popup-subtitle {
        font-size: 16px;
    }
    
    #popup-close {
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: 12px;
        right: 12px;
    }
    
    /* Mobile image adjustments */
    .popup-image-left,
    .popup-image-right {
        float: none;
        max-width: 100%;
        margin: 0 0 16px 0;
        text-align: center;
    }
    
    .popup-image img,
    .popup-image-left img,
    .popup-image-right img {
        border-radius: 6px;
        max-height: calc(var(--popup-image-max-height, 300px) * 0.6);
        width: auto;
        object-fit: contain;
    }
    
    /* Mobile button adjustments */
    .popup-button {
        padding: 14px 24px;
        font-size: 15px;
        min-width: 180px;
    }
    
    .popup-button-full-width {
        width: 100%;
        min-width: auto;
    }
    
    .popup-button-container {
        margin-top: 20px;
        padding-top: 16px;
    }
}

@media (max-width: 480px) {
    #popup-container {
        width: 95% !important;
        margin: 10px;
        min-width: 260px;
    }
    
    .popup-header {
        padding: 16px 20px 12px;
    }
    
    .popup-body {
        padding: 20px;
    }
    
    #popup-title {
        font-size: 18px;
    }
    
    #popup-content {
        font-size: 14px;
    }
    
    /* Mobile image adjustments for small screens */
    .popup-image {
        margin-bottom: 16px;
    }
    
    .popup-image img,
    .popup-image-left img,
    .popup-image-right img {
        border-radius: 6px;
        max-height: calc(var(--popup-image-max-height, 300px) * 0.6);
        width: auto;
        object-fit: contain;
    }
    
    /* Small mobile button adjustments */
    .popup-button {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 160px;
        border-radius: 10px;
    }
    
    .popup-button-full-width {
        width: 100%;
        min-width: auto;
    }
    
    .popup-button-container {
        margin-top: 16px;
        padding-top: 12px;
    }
}

/* Hide popup on very small screens if mobile is disabled */
@media (max-width: 480px) {
    .popup-mobile-disabled #popup-overlay,
    .popup-mobile-disabled #popup-container {
        display: none !important;
    }
}

/* Accessibility improvements */
#popup-container:focus {
    outline: 2px solid #4F7FFF;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .popup-fade-in,
    .popup-fade-out,
    .popup-slide-down-in,
    .popup-slide-down-out,
    .popup-slide-up-in,
    .popup-slide-up-out,
    .popup-zoom-in,
    .popup-zoom-out,
    .popup-bounce-in,
    .popup-bounce-out {
        animation: none;
    }
    
    #popup-container {
        transition: none;
    }
}

/* Popup Button Styles */
.popup-button-container {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(79, 127, 255, 0.1);
}

.popup-button-align-left {
    text-align: left;
}

.popup-button-align-center {
    text-align: center;
}

.popup-button-align-right {
    text-align: right;
}

.popup-button {
    background: var(--button-bg-color, linear-gradient(135deg, #4F7FFF 0%, #6B8FFF 100%));
    color: var(--button-text-color, #ffffff);
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 16px rgba(79, 127, 255, 0.3);
    min-width: 200px;
    font-family: inherit;
}

.popup-button-full-width {
    width: 100%;
    display: block;
}

.popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(79, 127, 255, 0.4);
    background: var(--button-hover-bg-color, linear-gradient(135deg, #3D6FEF 0%, #5B7FEF 100%));
    color: var(--button-text-color, #ffffff);
    text-decoration: none;
}

.popup-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 127, 255, 0.3);
}

/* Live Preview Styles */
#popup-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.4);
}

#popup-preview-container {
    position: fixed;
    z-index: 10000;
    padding: 0;
    box-shadow: 0 20px 60px rgba(79, 127, 255, 0.15);
    overflow: hidden;
    max-height: 90vh;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(79, 127, 255, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Preview responsive adjustments */
@media (max-width: 768px) {
    #popup-preview-container {
        width: 90% !important;
        max-width: 400px !important;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    #popup-preview-container {
        width: 95% !important;
        margin: 10px;
    }
}

/* Cache Busting Test - Version 2.4.0 - Page exclusion feature added! If you see this comment in browser dev tools, the new CSS is loaded! */

/* Color Picker Enhancement Styles */
.color-hex-input {
    font-family: monospace;
    text-transform: uppercase;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px 6px;
    transition: border-color 0.3s ease;
}

.color-hex-input:focus {
    outline: none;
    border-color: #4F7FFF;
    box-shadow: 0 0 0 2px rgba(79, 127, 255, 0.1);
}

.color-palette-container {
    max-width: 200px;
    line-height: 0;
}

.color-swatch {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    position: relative;
}