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

@font-face {
    font-family: 'Aveny-T';
    src: url('Fonts/Aveny-T.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'CosmopolitanScript';
    src: url('Fonts/CosmopolitanScriptRegular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Proxima-Nova-Semibold';
    src: url('Fonts/Proxima-Nova-Semibold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

/* ── Paleta Honda AI Studio ───────────────────────────────────────────────
   Fondo página  : #0d1520
   Panel/card    : #162030
   Input/select  : #1e2b3a
   Texto primario: #ffffff
   Texto labels  : #8b9db8
   Acento Honda  : #e53935
   Bordes        : #2a3545
──────────────────────────────────────────────────────────────────────── */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0d1520;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.editor-panel {
    background: #162030;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid #2a3545;
}

.editor-panel h1 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
}

.input-section {
    margin-bottom: 20px;
}

.input-section label {
    display: block;
    margin-bottom: 8px;
    color: #8b9db8;
    font-weight: 600;
    font-size: 14px;
}

.input-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #2a3545;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
    background: #1e2b3a;
    color: #ffffff;
}

.input-section textarea::placeholder {
    color: #4a6080;
}

.input-section textarea:focus {
    outline: none;
    border-color: #e53935;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group-inline {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: flex-end;
}

.control-group-inline .control-group {
    flex: 1;
}

.control-group label {
    color: #8b9db8;
    font-weight: 600;
    font-size: 14px;
}

.control-group input[type="color"] {
    width: 100%;
    height: 50px;
    border: 1px solid #2a3545;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s;
    background: #1e2b3a;
}

.control-group input[type="color"]:focus {
    outline: none;
    border-color: #e53935;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #2a3545;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e53935;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e53935;
    cursor: pointer;
    border: none;
}

.control-group select {
    padding: 10px;
    border: 1px solid #2a3545;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #1e2b3a;
    color: #ffffff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.control-group select:focus {
    outline: none;
    border-color: #e53935;
}

.control-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 8px;
    accent-color: #e53935;
}

.control-group > label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

#opacity-value, #font-size-value, #line-height-value, #letter-spacing-value,
#border-radius-value, #text-vertical-position-value {
    color: #e53935;
    font-weight: 600;
    font-size: 14px;
}

.download-btn {
    width: 100%;
    padding: 12px 20px;
    background: #e53935;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 57, 53, 0.4);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(229, 57, 53, 0.3);
}

.remove-bg-btn {
    margin-top: 8px;
    padding: 8px 12px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.remove-bg-btn:hover {
    background: #b71c1c;
}

.story-container {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.story-background {
    width: 100%;
    height: 100%;
    background: #808080;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    overflow: hidden;
}

.text-svg {
    position: relative;
    display: block;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    cursor: move;
    user-select: none;
    transition: transform 0.1s ease;
    overflow: hidden;
}

.bg-image-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.safe-zone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    z-index: 100;
}

/* Estilos de texto */
.text-preview.classic {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.5px;
}

.text-preview.modern {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.text-preview.neon {
    font-family: 'Arial Black', Arial, sans-serif;
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.text-preview.typewriter {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.text-preview.strong {
    font-family: Impact, 'Arial Black', sans-serif;
    letter-spacing: 1px;
}

.preview-panel {
    background: #162030;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid #2a3545;
}

.preview-panel h2 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 700;
}

/* Estilos para el selector de emojis */
.emoji-selector {
    position: relative;
}

.emoji-btn {
    background: #e53935;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    width: 100%;
}

.emoji-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.4);
}

.emoji-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #162030;
    border: 1px solid #2a3545;
    border-radius: 12px;
    padding: 15px;
    margin-top: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-height: 500px;
    overflow-y: auto;
}

.emoji-section {
    margin-bottom: 20px;
}

.emoji-section:last-child {
    margin-bottom: 0;
}

.emoji-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #8b9db8;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #2a3545;
}

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

.emoji-item {
    background: #1e2b3a;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: #243040;
    border-color: #e53935;
    transform: scale(1.1);
}

.emoji-item:active {
    transform: scale(0.95);
}

input[type="file"] {
    color: #ffffff;
}

input[type="file"]::file-selector-button {
    background: #1e2b3a;
    color: #ffffff;
    border: 1px solid #2a3545;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: background 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: #2a3f55;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
}
