/* Thank You Generator Styles */

#thank-you-generator {
    padding: 80px 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Template Selection Row */
.template-selection-row {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.template-scroll-wrapper {
    position: relative;
    margin: 0 -1rem;
}

.template-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f1f1f1;
    scroll-behavior: smooth;
}

.template-scroll-wrapper::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 0;
    width: 30px;
    height: calc(100% - 2rem);
    background: linear-gradient(to left, white, transparent);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 1rem;
    left: 0;
    width: 30px;
    height: calc(100% - 2rem);
    background: linear-gradient(to right, white, transparent);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-scroll-wrapper.show-right-shadow::before {
    opacity: 0.9;
}

.template-scroll-wrapper.show-left-shadow::after {
    opacity: 0.9;
}

.template-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.template-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.template-scroll-container::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 10px;
}

.template-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.template-horizontal-grid {
    display: flex;
    gap: 1.5rem;
    padding: 0 1rem;
    min-width: fit-content;
}

.template-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-width: 200px;
    flex-shrink: 0;
}

.template-card:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.2);
}

.template-card.active {
    border-color: #007bff;
    background: #f8f9ff;
}

.template-preview {
    width: 100%;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.preview-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    color: white;
    text-align: center;
}

.preview-content.shipt-delivery {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 50%, #8E24AA 100%);
}

.preview-content.modern-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.preview-content.elegant-simple {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.preview-content.professional-blue {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.preview-content.warm-orange {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
}

.preview-content.nature-green {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.preview-logo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.preview-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.preview-message {
    font-size: 0.8rem;
    opacity: 0.9;
}

.template-name {
    text-align: center;
    font-weight: 500;
    color: #495057;
}

/* Editor Section */
.editor-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Preview Section */
.preview-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.card-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

#cardCanvas {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    max-width: 100%;
    height: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.export-actions {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 991px) {
    .template-card {
        min-width: 180px;
    }

    .template-preview {
        height: 120px;
    }

    .preview-logo {
        font-size: 1.8rem;
    }

    .preview-title {
        font-size: 0.95rem;
    }

    .preview-message {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    #thank-you-generator {
        padding: 40px 0;
    }

    .template-selection-row,
    .editor-section,
    .preview-section {
        padding: 1.5rem;
    }

    .template-card {
        min-width: 160px;
    }

    .template-preview {
        height: 100px;
    }

    .preview-logo {
        font-size: 1.5rem;
    }

    .preview-title {
        font-size: 0.85rem;
    }

    .preview-message {
        font-size: 0.7rem;
    }

    #cardCanvas {
        width: 300px;
        height: 450px;
    }
}

/* Animation */
.template-card,
.editor-section,
.preview-section {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active nav item */
.nav-item.active {
    color: #007bff !important;
    font-weight: 600;
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Character count */
.char-count {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: right;
    margin-top: 0.25rem;
}

.char-count.warning {
    color: #ffc107;
}

.char-count.danger {
    color: #dc3545;
}

/* Tooltip */
.tooltip-text {
    position: relative;
    cursor: help;
}

.tooltip-text::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip-text:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Service Promotion Section */
.service-promo-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    margin-top: 1rem;
    min-height: auto;
    animation: promo-entrance 0.8s ease-out, promo-pulse 3s ease-in-out 2s infinite;
    transform-origin: center;
}
.bi-lightning-charge {
    font-size: 1.2rem;
}

.service-promo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #28a745, #ffc107);
    border-radius: 12px 12px 0 0;
}

.service-promo-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
    animation-play-state: paused;
}

.promo-header {
    margin-bottom: 0.75rem;
}

.promo-title {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1.0rem;
    line-height: 1.3;
}

.promo-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.promo-text {
    color: #495057;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0;
    flex: 1;
}

.promo-action {
    display: flex;
    justify-content: center;
}

.promo-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: none;
    box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
    transition: all 0.3s ease;
    white-space: nowrap;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.promo-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(0, 123, 255, 0.35);
    color: white;
    text-decoration: none;
}

.promo-btn .badge {
    font-size: 0.65rem;
    padding: 2px 5px;
    margin-left: 8px;
}

/* Promotion Card Animations */
@keyframes promo-entrance {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes promo-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.12);
    }
}

/* Button pulse animation */
.promo-btn {
    animation: btn-glow 2s ease-in-out 3s infinite;
}

@keyframes btn-glow {
    0%, 100% {
        box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
    }
    50% {
        box-shadow: 0 5px 20px rgba(0, 123, 255, 0.4);
        transform: translateY(-1px) scale(1.02);
    }
}

/* Responsive adjustments for promo */
@media (max-width: 768px) {
    .service-promo-card {
        padding: 1rem;
        text-align: center;
    }

    .promo-title {
        font-size: 1rem;
        line-height: 1.2;
    }

    .promo-text {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .promo-body {
        gap: 0.5rem;
    }

    .promo-btn {
        width: 100%;
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .promo-btn .badge {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
}

/* Download Success Modal */
.download-modal {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.download-modal .modal-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 2rem 1.5rem 1rem;
    position: relative;
}

.download-modal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="30" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="70" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    pointer-events: none;
}

.success-icon {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    animation: success-bounce 0.6s ease-out;
}

.success-icon i {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.download-modal .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.download-modal .btn-close {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    opacity: 0.8;
}

.download-modal .btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
}

.download-modal .modal-body {
    padding: 2rem 1.5rem;
}

.download-info {
    margin-bottom: 1.5rem;
}

.download-message {
    font-size: 1.1rem;
    color: #495057;
    margin-bottom: 1rem;
}

.progress-container {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.download-progress {
    background: linear-gradient(90deg, #007bff, #28a745);
    height: 100%;
    border-radius: 10px;
    width: 0%;
    animation: download-progress 2s ease-in-out forwards;
    position: relative;
}

.download-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 1.5s ease-in-out infinite;
}

.service-promotion {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #dee2e6;
    position: relative;
    overflow: hidden;
}

.service-promotion::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745, #ffc107);
}

.promo-heading {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.promo-description {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.promo-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #495057;
}

.feature-item i {
    font-size: 1rem;
}

.modal-cta-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

.modal-cta-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    color: white;
}

/* Modal Animations */
@keyframes success-bounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes download-progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}
