* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    color: #fff;
    position: relative;
    overflow-x: hidden;
}

h1 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

h1 svg {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.subtitle {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    text-align: center;
}

.editor-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 600px;
    width: 100%;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 360px;
    max-height: 70vh;
    aspect-ratio: 720 / 1280;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background: #2d3a4f;
}

#previewCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: move;
}

.upload-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(45, 58, 79, 0.95);
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #e85d4c;
    background: rgba(45, 58, 79, 0.98);
}

.upload-zone.drag-over {
    border-color: #e85d4c;
    background: rgba(232, 93, 76, 0.1);
}

.upload-zone.hidden {
    display: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.upload-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

#fileInput {
    display: none;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.name-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.name-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.name-input:focus {
    border-color: #e85d4c;
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.text-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.font-style-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.font-style-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    transition: all 0.2s ease;
}

.font-style-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.font-style-btn.active {
    background: rgba(232, 93, 76, 0.2);
    border-color: #e85d4c;
    color: #fff;
}

.frame-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.frame-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.frame-option {
    width: 100%;
    aspect-ratio: 720 / 1280;
    border-radius: 10px;
    border: 3px solid transparent;
    padding: 2px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    overflow: hidden;
}

.frame-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.frame-option:hover {
    border-color: rgba(232, 93, 76, 0.5);
}

.frame-option.active {
    border-color: #e85d4c;
    box-shadow: 0 0 0 2px rgba(232, 93, 76, 0.3);
}

.slider-group {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 360px;
}

.slider-group.visible {
    display: flex;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e85d4c;
    cursor: pointer;
    transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #e85d4c 0%, #c94a3a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(232, 93, 76, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 93, 76, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.instructions {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.instructions strong {
    color: rgba(255, 255, 255, 0.9);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d3a4f;
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #4ade80;
}

.toast.error {
    border-left: 4px solid #f87171;
}

.language-toggle {
    display: flex;
    gap: 10px;
    align-self: flex-end;
    margin-bottom: 20px;
}

.language-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.language-btn.active {
    background: #e85d4c;
    border-color: #e85d4c;
    color: #fff;
    box-shadow: 0 4px 12px rgba(232, 93, 76, 0.3);
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }

    .canvas-wrapper {
        max-width: 260px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Snowflakes */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: #fff;
    font-size: 1em;
    opacity: 0.8;
    animation: fall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes fall {
    0% {
        top: -10%;
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}
