:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --primary-font: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
}

.saigon-ecard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.saigon-ecard-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.saigon-ecard-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1;
}

.saigon-ecard-card-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    height: 98vh;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    font-family: var(--primary-font);
    overflow: hidden;
}

@media (min-width: 768px) {
    .saigon-ecard-card-container {
        border-radius: 16px;
        height: 90vh;
        max-height: 700px;
    }
}

.close-modal {
    position: absolute;
    top: 5px;
    right: 10px;
    color: #ffd700;
    font-size: 24px;
    z-index: 100;
    cursor: pointer;
    font-weight: bold;
}

/* Tabs - 극도로 축소 */
.ecard-tabs {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    gap: 3px;
    padding: 4px 0 2px;
    background: #0a0a0a;
    border-bottom: 1px solid #222;
}

.tab-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #ffd700;
    color: #000;
    font-weight: bold;
    border-color: #ffd700;
}

/* Carousel - 최소화 */
.template-carousel-wrapper {
    flex-shrink: 0;
    background: #0a0a0a;
    padding: 3px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.template-carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.template-carousel {
    display: inline-flex;
    padding: 0 8px;
    gap: 6px;
}

.template-item {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid transparent;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    flex-shrink: 0;
}

.template-item.active {
    opacity: 1;
    border-color: #ffd700;
    transform: scale(1.1);
}

/* Preview - 최대한 크게 */
.ecard-preview-wrapper {
    flex: 1;
    position: relative;
    background: #000;
    width: 100%;
    overflow: hidden;
    min-height: 0;
}

.ecard-preview-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Input Area - 극도로 축소 */
.ecard-input-area {
    flex-shrink: 0;
    background: #0a0a0a;
    padding: 4px 8px;
    border-top: 1px solid #222;
}

.input-row {
    display: flex;
    gap: 4px;
    margin-bottom: 3px;
}

.input-row input {
    flex: 1;
    min-width: 0;
}

input,
textarea {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-family: var(--primary-font);
}

input:focus,
textarea:focus {
    border-color: #ffd700;
    outline: none;
}

textarea {
    height: 30px;
    resize: none;
    line-height: 1.3;
}

/* Action Button - 축소 */
.saigon-ecard-actions {
    flex-shrink: 0;
    padding: 4px 8px 6px;
    background: #0a0a0a;
}

.btn-action {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    background: #FEE500;
    color: #3C1E1E;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:active {
    transform: scale(0.98);
}

/* Floating Button */
.saigon-ecard-floating-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    animation: float 3s ease-in-out infinite;
}

.saigon-ecard-floating-btn:hover {
    transform: scale(1.1);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}