﻿@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Color Theme Grid Styles - COMPACT VERSION */
.color-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .color-theme-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .color-theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.color-theme-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

    .color-theme-card:hover {
        border-color: #667eea;
        transform: translateY(-3px);
        box-shadow: 0 6px 15px rgba(102, 126, 234, 0.2);
    }

    .color-theme-card.selected {
        border-color: #667eea;
        background: linear-gradient(135deg, #f7fafc 0%, #e6f0ff 100%);
        box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
    }

        .color-theme-card.selected::before {
            content: '✓';
            position: absolute;
            top: 4px;
            right: 4px;
            width: 20px;
            height: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
            animation: checkmarkPop 0.3s ease;
            z-index: 1;
        }

@keyframes checkmarkPop {
    0% {
        transform: scale(0) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(180deg);
    }

    100% {
        transform: scale(1) rotate(360deg);
    }
}

.theme-icon {
    font-size: 28px;
    margin: 0;
    line-height: 1;
}

.theme-name {
    font-size: 11px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    word-wrap: break-word;
    line-height: 1.2;
    max-width: 100%;
}

/* Rectangular color bars - NEW COMPACT DESIGN */
.theme-colors {
    display: flex;
    justify-content: center;
    gap: 3px;
    width: 100%;
    height: 8px;
}

.color-dot {
    flex: 1;
    height: 100%;
    border-radius: 2px;
    border: none;
    box-shadow: none;
    transition: transform 0.2s ease;
}

.color-theme-card:hover .color-dot {
    transform: scaleY(1.3);
}

/* Rich Text Editor Styles */
.rich-text-toolbar {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding: 8px;
}

.rich-text-editor {
    min-height: 250px;
    max-height: 400px;
    border: 2px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    background: white;
    font-size: 15px;
    overflow-y: auto; /* Enable vertical scroll */
}

    /* Scrollbar styling for editor */
    .rich-text-editor::-webkit-scrollbar {
        width: 8px;
    }

    .rich-text-editor::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .rich-text-editor::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 4px;
    }

        .rich-text-editor::-webkit-scrollbar-thumb:hover {
            background: #5568d3;
        }

/* Quill size styles - Fix for issue #1 */
.ql-editor .ql-size-small {
    font-size: 0.75em;
}

.ql-editor .ql-size-large {
    font-size: 1.5em;
}

.ql-editor .ql-size-huge {
    font-size: 2.5em;
}

/* Custom pixel-based font sizes - NEW */
.ql-editor .ql-size-10px {
    font-size: 10px;
}

.ql-editor .ql-size-12px {
    font-size: 12px;
}

.ql-editor .ql-size-14px {
    font-size: 14px;
}

.ql-editor .ql-size-16px {
    font-size: 16px;
}

.ql-editor .ql-size-18px {
    font-size: 18px;
}

.ql-editor .ql-size-20px {
    font-size: 20px;
}

.ql-editor .ql-size-24px {
    font-size: 24px;
}

.ql-editor .ql-size-28px {
    font-size: 28px;
}

.ql-editor .ql-size-32px {
    font-size: 32px;
}

/* Custom pixel-based font sizes */
.ql-editor span[style*="font-size"] {
    /* Preserve inline font-size styles */
}

/* Also apply sizes to preview */
.desktop-preview-text .ql-size-small,
.preview-text .ql-size-small {
    font-size: 0.75em !important;
}

.desktop-preview-text .ql-size-large,
.preview-text .ql-size-large {
    font-size: 1.5em !important;
}

.desktop-preview-text .ql-size-huge,
.preview-text .ql-size-huge {
    font-size: 2.5em !important;
}

/* Apply custom pixel sizes to preview - NEW */
.desktop-preview-text .ql-size-10px,
.preview-text .ql-size-10px {
    font-size: 10px !important;
}

.desktop-preview-text .ql-size-12px,
.preview-text .ql-size-12px {
    font-size: 12px !important;
}

.desktop-preview-text .ql-size-14px,
.preview-text .ql-size-14px {
    font-size: 14px !important;
}

.desktop-preview-text .ql-size-16px,
.preview-text .ql-size-16px {
    font-size: 16px !important;
}

.desktop-preview-text .ql-size-18px,
.preview-text .ql-size-18px {
    font-size: 18px !important;
}

.desktop-preview-text .ql-size-20px,
.preview-text .ql-size-20px {
    font-size: 20px !important;
}

.desktop-preview-text .ql-size-24px,
.preview-text .ql-size-24px {
    font-size: 24px !important;
}

.desktop-preview-text .ql-size-28px,
.preview-text .ql-size-28px {
    font-size: 28px !important;
}

.desktop-preview-text .ql-size-32px,
.preview-text .ql-size-32px {
    font-size: 32px !important;
}

/* Preserve custom font sizes in preview */
.desktop-preview-text span[style*="font-size"],
.preview-text span[style*="font-size"],
#kvietimoTekstasR span[style*="font-size"] {
    /* Inline font-size will be preserved */
}

/* Emoji Button in Toolbar */
.emoji-button {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

    .emoji-button:hover {
        background: #f0f0f0;
        border-color: #667eea;
    }

/* Emoji Picker Popup */
.emoji-picker-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10002; /* Increased from 3000 to be above preview modal */
    width: 90%;
    max-width: 400px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.emoji-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #2d3748;
}

.emoji-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    border: none;
    font-size: 24px;
    color: #2d3748;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .emoji-close:hover {
        background: #cbd5e0;
        transform: rotate(90deg);
    }

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.emoji-item {
    font-size: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

    .emoji-item:hover {
        background: #f7fafc;
        transform: scale(1.2);
    }

/* Countdown outside invitation - Fix for issue #2 */
.countdown-outside {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile countdown alignment fix - show below invitation on small screens */
@media (max-width: 768px) {
    .preview-modal .preview-content {
        display: flex;
        flex-direction: column;
    }

    .preview-countdown {
        order: 2; /* Show countdown after invitation */
        margin-top: 20px;
    }

    .preview-invitation {
        order: 1; /* Show invitation first */
    }
}

/* Plan Cards Styles */
.plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.plan-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
}

    .plan-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-color: #667eea;
    }

.plan-featured {
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.plan-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.plan-name {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
}

.plan-price {
    margin: 10px 0;
}

.price-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

    .plan-features li {
        padding: 10px 0;
        color: #4a5568;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .plan-features i {
        color: #48bb78;
        font-size: 16px;
        flex-shrink: 0;
    }

.discount-section {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.discount-input {
    flex: 1;
    padding: 10px !important;
    font-size: 13px !important;
}

.btn-apply-discount {
    padding: 10px 15px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 45px;
}

    .btn-apply-discount:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    }

/* Invitation auto-stretch styles - UPDATED with proper containment */
.preview-invitation,
.desktop-preview-invitation {
    min-height: 500px !important;
    height: auto !important; /* Allow stretching */
    width: 100% !important; /* Full width */
    max-width: 100% !important; /* Don't overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 30px;
    overflow: visible !important; /* Allow content to expand naturally */
    box-sizing: border-box !important; /* Include padding */
    flex-shrink: 0 !important; /* Don't shrink the card */
}

.preview-greeting,
.preview-text,
.preview-signature,
.desktop-preview-greeting,
.desktop-preview-text,
.desktop-preview-signature {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal; /* Changed from break-word for better flow */
    max-width: 100%;
    width: 100%;
    overflow: visible; /* Changed from hidden to visible */
    box-sizing: border-box;
}

/* Ensure text doesn't overflow */
.preview-text,
.desktop-preview-text {
    max-width: 100%;
    max-height: none !important; /* Remove height restriction */
    overflow-wrap: break-word;
    word-break: normal; /* Better text flow */
    overflow: visible; /* Changed from hidden to visible */
    white-space: normal; /* Allow normal wrapping */
    line-height: 1.0; /* Consistent line-height */
    line-height: 1.4; /* Uniform line-height for all lines */
}

    /* Ensure Quill formatted content stays within bounds */
    .preview-text p,
    .preview-text span,
    .preview-text div,
    .desktop-preview-text p,
    .desktop-preview-text span,
    .desktop-preview-text div {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: normal !important; /* Better text flow */
        max-width: 100% !important;
        line-height: inherit !important; /* Inherit parent line-height */
        line-height: 1.4 !important; /* Uniform line-height */
    }

    /* Remove paragraph margins - rely on line-height for uniform spacing */
    .preview-text p,
    .desktop-preview-text p {
        margin: 0 !important;
    }
/* kvietimasR auto-stretch for actual invitations */
.kvietimasR {
    min-height: 500px !important;
    height: auto !important; /* Remove fixed height */
    width: 100% !important; /* Full width */
    max-width: 100% !important; /* Don't overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 30px;
    overflow: hidden !important; /* Contain content */
    box-sizing: border-box !important;
}

#kvietimoTekstasR {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    width: 100%;
    max-height: none !important; /* Remove height restriction */
    overflow: hidden !important; /* Hide overflow */
    white-space: normal; /* Changed from pre-wrap */
    box-sizing: border-box;
}

    /* Ensure all child elements respect boundaries */
    #kvietimoTekstasR p,
    #kvietimoTekstasR span,
    #kvietimoTekstasR div {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        max-width: 100% !important;
    }
