:root {
    --bg-dark: #050505;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --grad-fuchsia-violet: linear-gradient(135deg, #ff007f 0%, #7e22ce 100%);
    --neon-fuchsia: #ff007f;
    --neon-violet: #7e22ce;
    --radius-pill: 12px;
    --radius-card: 24px;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-serif: 'Newsreader', serif;
}
.book-font { 
    font-family: var(--font-serif); 
    line-height: 1.8; 
    color: rgba(255,255,255,0.95); 
    font-size: clamp(1rem, 4vw, 1.25rem); 
    padding: 20px 5%;
}
.book-font p { 
    margin-bottom: 28px; 
    text-align: justify; 
    letter-spacing: 0.01em;
}
.book-font h2 { 
    margin-top: 60px; 
    margin-bottom: 30px; 
    font-family: var(--font-heading); 
    color: white; 
    font-weight: 700; 
    line-height: 1.2; 
    font-size: clamp(1.6rem, 6vw, 2.4rem); 
}
.book-font h3 { 
    margin-top: 40px; 
    margin-bottom: 20px; 
    font-family: var(--font-heading); 
    color: white; 
    font-weight: 600; 
    font-size: clamp(1.3rem, 5vw, 1.8rem); 
}
.book-font ul, .book-font ol { margin-bottom: 28px; padding-left: 25px; }
.book-font li { margin-bottom: 15px; text-align: justify; }
.book-font blockquote { 
    margin: 40px 0; 
    padding: 25px 35px; 
    border-left: 5px solid var(--neon-fuchsia); 
    background: rgba(255,0,127,0.03); 
    font-style: italic; 
    color: rgba(255,255,255,0.85); 
    border-radius: 0 16px 16px 0;
    font-size: 1.1rem;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg-dark); color: var(--text-main); font-family: var(--font-body); line-height: 1.5; display: flex; justify-content: center; min-height: 100vh; overflow-y: auto; }
.app-container { width: 100%; max-width: 800px; height: 100vh; display: flex; flex-direction: column; background: var(--bg-dark); box-shadow: 0 0 50px rgba(0,0,0,0.8); position: relative; }
.hidden { display: none !important; }

/* Dashboard P1 */
.progress-dashboard { display: flex; justify-content: space-between; padding: 12px 10px; border-bottom: none; z-index: 10; transition: opacity 0.3s; background: #050505; backdrop-filter: blur(10px); }
.step { display: flex; flex-direction: column; align-items: center; opacity: 0.2; transition: 0.3s; flex: 1; min-width: 0; }
.step.active { opacity: 1; }
.step-indicator { width: 85%; max-width: 50px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 4px; margin-bottom: 5px; position: relative; overflow: hidden; }
.step.active .step-indicator { background: var(--grad-fuchsia-violet); box-shadow: 0 0 10px var(--neon-fuchsia); }
.step.active .step-indicator::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: sweep 2s infinite; }
@keyframes sweep { 100% { left: 100%; } }
.step span { font-size: 0.55rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; color: var(--text-muted); }
.step.active span { color: var(--neon-fuchsia); text-shadow: 0 0 5px rgba(255,0,127,0.4); }

@media (max-width: 500px) {
    .progress-dashboard { padding: 8px 5px; gap: 5px; }
    .step span { font-size: 0.45rem; letter-spacing: 0; }
    .step-indicator { max-width: 40px; height: 3px; }
}

@media (max-width: 380px) {
    .progress-dashboard { padding: 6px 4px; gap: 2px; }
    .step span { font-size: 0.4rem; }
    .step-indicator { width: 90%; max-width: 30px; height: 2px; border-radius: 2px; }
    .step.active .step-indicator { height: 4px; }
}

@media (max-width: 480px) {
    #quick-setup-p1 {
        padding: 5px 10px !important;
        margin-bottom: 5px !important;
    }
    #quick-setup-p1 > div {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px !important;
    }
    #quick-setup-p1 input, #quick-setup-p1 button {
        height: 28px !important;
        font-size: 0.7rem !important;
    }
    #quick-setup-p1 label {
        display: none !important;
    }
}

/* Content Area */
.content-area { 
    flex: 1; 
    overflow-y: auto; 
    padding: clamp(20px, 6vw, 40px) clamp(15px, 5vw, 40px) 140px; 
    display: flex; 
    flex-direction: column; 
    gap: 30px;
}
.start-selector { flex:1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.brand-title { 
    font-family: var(--font-heading); 
    font-size: clamp(2rem, 10vw, 3.5rem); 
    background: var(--grad-fuchsia-violet); 
    -webkit-background-clip: text; 
    background-clip: text; 
    -webkit-text-fill-color: transparent; 
    text-align: center;
    line-height: 1.1;
    margin-bottom: 10px;
}
.brand-subtitle { 
    color: var(--text-muted); 
    margin-bottom: 50px; 
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    text-align: center;
}
.action-buttons { width: 100%; display: flex; flex-direction: column; gap: 20px; }

/* Buttons */
.btn { width: 100%; padding: 18px 24px; border-radius: var(--radius-pill); font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform 0.2s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--grad-fuchsia-violet); color: white; box-shadow: 0 8px 25px rgba(255, 0, 127, 0.3); }
.btn-neon-violet { background: linear-gradient(135deg, #7030EF, #DB1FFF); color: white; box-shadow: 0 8px 25px rgba(112, 48, 239, 0.3); border: 1px solid rgba(219, 31, 255, 0.2); }
.btn-neon-violet:hover { box-shadow: 0 8px 35px rgba(112, 48, 239, 0.5); transform: translateY(-2px); }

.btn-success { background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%); color: white; border: none; box-shadow: 0 8px 25px rgba(0, 176, 155, 0.3); }
.btn-success:hover { box-shadow: 0 8px 30px rgba(0, 176, 155, 0.5); transform: translateY(-2px); }

.btn-secondary { background: transparent; border: 1px solid var(--glass-border); color: var(--text-main); transition: all 0.3s; }
.btn-secondary:hover { border-color: var(--neon-fuchsia); background: rgba(255,0,127,0.05); box-shadow: 0 0 15px rgba(255,0,127,0.1); }

/* Chat P1 */
.chat-console { flex: 1; display: flex; flex-direction: column; }
.chat-stream { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px;}
.chat-bubble { max-width: 85%; padding: 16px 20px; border-radius: 20px; font-size:0.95rem; }
.ai-bubble { align-self: flex-start; background: var(--glass-bg); border: 1px solid var(--glass-border); border-bottom-left-radius: 4px; backdrop-filter: blur(10px); }
.user-bubble { align-self: flex-end; background: var(--grad-fuchsia-violet); color: white; border-bottom-right-radius: 4px; }

/* Footers */
.bottom-bar { 
    padding: 10px 15px 15px; 
    background: #050505; 
    z-index: 100;
    position: relative;
    border-top: 1px solid var(--glass-border);
}

@media (max-width: 600px) {
    .bottom-bar { 
        position: fixed; 
        bottom: 0; 
        left: 0; 
        width: 100%;
        padding: 10px;
        background: rgba(5,5,5,0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    }
    .content-area {
        padding-bottom: 160px !important; /* Espacio extra para el footer fijo */
    }
}
.quick-replies { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 12px; justify-content: flex-start; }
.quick-reply-chip { padding: 8px 14px; border-radius: var(--radius-pill); background: var(--glass-bg); border: 1px solid var(--neon-violet); color: var(--text-main); cursor: pointer; text-align: center; font-size: 0.8rem; }
.glass-panel { 
    background: var(--glass-bg); 
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-card); 
    padding: clamp(20px, 5vw, 35px); 
    backdrop-filter: blur(25px); 
}
.input-wrapper { 
    display: flex; 
    align-items: center; 
    background: rgba(0,0,0,0.6); 
    border-radius: var(--radius-pill); 
    padding: 6px 10px 6px 24px; 
}
#chat-input { 
    flex: 1; 
    background: transparent; 
    border: none; 
    color: white; 
    font-family: var(--font-body); 
    outline: none; 
    padding: 14px 0; 
    font-size: 1.05rem;
}
.btn-icon { width: 44px; height: 44px; border-radius: var(--radius-pill); border: none; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-mic { background: transparent; color: var(--neon-fuchsia); }
.btn-send { background: var(--grad-fuchsia-violet); color: white; }
.dock-container { display:flex; flex-direction:column; gap:12px; padding:20px; border-radius:24px; transition: all 0.3s ease; }
@media (max-width: 600px) {
    .dock-container { padding: 12px; gap: 8px; }
    .dock-container > div { flex-wrap: wrap; justify-content: center !important; }
    .dock-container .btn { padding: 10px 12px !important; font-size: 0.8rem !important; height: auto !important; min-height: 40px; }
    .dock-container .btn-icon { width: 38px; height: 38px; flex-shrink: 0; }
}

/* Processing */
#processing-container { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.loader-rings { position:relative; width:100px; height:100px; margin-bottom:40px; display:flex; align-items:center; justify-content:center; }
.ring { position:absolute; border-radius:50%; border:3px solid transparent; transform-origin: center; }
.ring-1 { width:100%; height:100%; border-top-color:var(--neon-fuchsia); border-bottom-color:var(--neon-violet); border-right-color:var(--neon-fuchsia); animation:spin-loader 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite; filter: drop-shadow(0 0 8px var(--neon-fuchsia)); }
.ring-2 { width:70%; height:70%; border-left: 2px solid var(--neon-fuchsia); border-top: 2px solid var(--neon-violet); animation:spin-loader 1.5s linear infinite reverse; opacity: 0.8; }
.ring-3 { width:40%; height:40%; border: 2px solid white; border-top-color: transparent; border-bottom-color: transparent; animation:spin-loader 1s ease-in-out infinite; }
@keyframes spin-loader { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.processing-title { font-family:var(--font-heading); font-size:1.5rem; text-shadow:0 0 15px var(--neon-fuchsia); margin-bottom:8px; color:white; font-weight:600;}
.processing-subtitle { color:var(--text-muted); font-size:0.9rem; }

/* Phase 2: Index */
.index-list { display:flex; flex-direction:column; gap:16px; padding-bottom:40px; }
.index-card { background:var(--glass-bg); border:1px solid var(--glass-border); border-radius:var(--radius-card); padding:16px 20px; display:flex; justify-content:space-between; align-items:center; backdrop-filter:blur(10px); }
.chapter-num { font-size:0.8rem; color:var(--text-muted); text-transform:uppercase; margin-bottom:4px; display:block; }
.chapter-title { font-family:var(--font-heading); font-size:1.1rem; outline: none; border-bottom: 1px dashed transparent; transition: border-color 0.2s; }
.chapter-title:focus { border-bottom-color: var(--neon-fuchsia); color: var(--neon-fuchsia); }
.card-actions { display:flex; gap:16px; color:var(--text-muted); font-size:1.3rem; }
.card-actions ion-icon:hover { color:var(--neon-fuchsia); }
.sortable-ghost { opacity: 0.4; background-color: rgba(255, 0, 127, 0.1); border: 1px dashed var(--neon-fuchsia); }

/* Phase 3 & 4 base */
.glass-panel-container { background:var(--glass-bg); border:1px solid var(--glass-border); border-radius:24px; padding:24px; height:auto; min-height:100%; backdrop-filter:blur(10px); }
.writing-content { width: 100%; }

/* Editorial Markdown Rendering (Preview) */
.book-serif { 
    font-family: var(--font-serif); 
    color: rgba(255,255,255,0.9); 
    line-height: 1.6; 
    text-align: justify;
}
.book-serif h1 { 
    font-size: 2rem; 
    color: white; 
    text-align: center; 
    margin-bottom: 30px; 
    font-family: var(--font-heading);
    font-weight: 700;
}
.book-serif h2 { 
    font-size: 1.5rem; 
    color: rgba(255,255,255,0.95); 
    margin: 30px 0 15px;
    font-weight: 600;
}
.book-serif p { 
    font-size: 1.05rem; 
    margin-bottom: 20px; 
    line-height: 1.7;
}
.book-serif blockquote { 
    font-style: italic; 
    border-radius: 4px;
    margin: 30px 0;
}
.book-serif hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 40px 0; }
.skeleton-text { height:16px; background:linear-gradient(90deg, #1f1f1f 25%, #2a2a2a 50%, #1f1f1f 75%); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:4px; margin-bottom:12px; }
.skeleton-text.short { width:60%; }
@keyframes shimmer { 100% { background-position: -200% 0; } }
.generating-status { display:flex; align-items:center; gap:10px; color:var(--neon-fuchsia); font-size:0.9rem; margin-top:20px; padding-top:16px; border-top:1px solid var(--glass-border); }
.pulse-dot { width:10px; height:10px; background:var(--neon-fuchsia); border-radius:50%; box-shadow:0 0 10px var(--neon-fuchsia); animation:pulse 1s infinite alternate; }
@keyframes pulse { from { opacity:0.4; transform:scale(0.8); } to { opacity:1; transform:scale(1.2); } }

/* Export Preview P4 */
.export-page { max-width: 600px; margin: 0 auto; }
.export-h1 { font-size: 2.2rem; text-align: center; margin-bottom: 40px; font-weight: 500; }
.drop-cap-para { position: relative; }
.drop-cap { float: left; font-size: 3.5rem; line-height: 0.8; padding-right: 8px; color: white; }

/* Menu Lateral Nav */
.transform-out { transform: translateX(100%); }

/* Final Phase */
.success-title { font-family:var(--font-heading); font-size:2.5rem; text-align:center; margin-bottom:15px; text-shadow:0 0 15px var(--neon-fuchsia); padding: 0 15px; line-height: 1.2; }
@media (max-width: 600px) { .success-title { font-size: 1.6rem; margin-top: 10px; } }
.prompt-desc { color:var(--text-muted); margin-bottom:20px; font-size:0.95rem; }
.terminal-block { background:#000; border:1px solid #333; border-radius:12px; padding:40px 20px 20px 20px; position:relative; }
.terminal-block code { font-family:monospace; color:#ccc; word-break:break-all; font-size:0.9rem; }
.btn-copy { position:absolute; top:10px; right:10px; background:var(--glass-bg); border:1px solid var(--glass-border); color:white; padding:6px 12px; border-radius:6px; cursor:pointer; display:flex; gap:6px; }

/* Animación de Carga y Edición */
.loading-spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; display: inline-block; animation: spin-simple 0.8s linear infinite; }
@keyframes spin-simple { to { transform: rotate(360deg); } }

.editing-bubble { outline: 2px solid var(--neon-fuchsia) !important; background: rgba(255,0,127,0.2) !important; cursor: text; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Credits Badge Premium */
.credits-pill {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(15px);
    color: #f1c40f;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 0 10px rgba(255, 215, 0, 0.05);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.credits-pill:hover {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15);
    transform: translateY(-1px);
}
.credits-pill ion-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
    animation: gold-pulse 2s infinite;
}
@keyframes gold-pulse {
    0% { filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3)); }
    50% { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)); }
    100% { filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3)); }
}

/* Modal Sin Créditos */
.no-credits-content {
    animation: modal-appear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-appear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.neon-text-fuchsia {
    color: var(--neon-fuchsia);
    text-shadow: 0 0 10px rgba(255,0,127,0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

@media (max-width: 500px) {
    .credits-pill {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

/* Style Cards Initial Selector */
.style-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.style-card:hover {
    border-color: var(--neon-fuchsia) !important;
    background: rgba(255, 0, 127, 0.05) !important;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 0, 127, 0.1);
}
.style-card ion-icon[name="chevron-forward"] {
    transition: transform 0.3s, color 0.3s;
}
.style-card:hover ion-icon[name="chevron-forward"] {
    transform: translateX(8px);
    color: var(--neon-fuchsia);
    opacity: 1;
}
.style-card h3 {
    transition: color 0.3s;
}
.style-card:hover h3 {
    color: var(--neon-fuchsia) !important;
}

/* CHIPS INTERACTIVOS PARA CHAT */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--neon-fuchsia);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chip:hover {
    background: var(--neon-fuchsia);
    box-shadow: 0 0 10px var(--neon-fuchsia);
    transform: translateY(-2px);
}

/* ANALYSIS REPORT POLISHED VIEW */
.analysis-report {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.analysis-section {
    margin-bottom: 22px;
}
.analysis-header {
    color: var(--neon-fuchsia);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1.5px;
    font-family: var(--font-heading);
}
.analysis-header ion-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px var(--neon-fuchsia));
}
.analysis-p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
}
.report-bubble {
    background: rgba(112, 48, 239, 0.08) !important;
    border: 1px solid rgba(219, 31, 255, 0.3) !important;
    border-radius: 24px !important;
    padding: 30px !important;
    max-width: 95% !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), inset 0 0 20px rgba(112, 48, 239, 0.05);
}
/* ==================== TIENDA DE CRÉDITOS ==================== */
.credits-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(5, 5, 10, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60000;
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
}

.credits-shop-container {
    width: 95%;
    max-width: 950px;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 10px;
    border-radius: 32px;
    scrollbar-width: thin;
    -ms-overflow-style: auto;
}

@media (max-width: 650px) {
    .credits-shop-container {
        padding: 50px 5px 20px;
    }
}
.credits-shop-container::-webkit-scrollbar { display: block; }

.credit-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.credit-option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 35px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(15px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.credit-option:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.05);
}

.credit-option.featured {
    border-color: var(--neon-violet);
    box-shadow: 0 0 30px rgba(112, 48, 239, 0.15);
}

.credit-option.featured:hover {
    border-color: var(--neon-fuchsia);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 0, 127, 0.2);
}

.price-row {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: auto;
    justify-content: center;
}

/* Plan Anual Mobile Fix */
@media (max-width: 768px) {
    .shop-plans-grid {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    .plan-anual-mobile {
        grid-column: 1 / -1 !important;
    }
    .plan-anual-mobile > div {
        flex-direction: column !important;
        text-align: center !important;
    }
    .plan-anual-mobile div[style*="text-align: left"],
    .plan-anual-mobile div[style*="text-align: right"] {
        text-align: center !important;
        min-width: 100% !important;
    }
    .credit-option {
        padding: 40px 20px !important;
    }
}

@keyframes pulse-slow {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(112, 48, 239, 0.3); }
    50% { transform: scale(1.02); box-shadow: 0 0 35px rgba(112, 48, 239, 0.6); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(112, 48, 239, 0.3); }
}
.animate-pulse-slow {
    animation: pulse-slow 4s infinite ease-in-out;
}

@media (max-width: 500px) {
    #side-nav .btn {
        font-size: 0.8rem !important;
        padding: 8px 10px !important;
    }
    #side-nav h3 { font-size: 1.1rem; }
    #side-nav h4 { font-size: 0.8rem; margin-top: 10px; }
}
/* --- BIBLIOTECA DE PROYECTOS (ESTILO PREMIUM) --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 10px;
    padding-bottom: 30px;
}

.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px !important;
    min-height: 140px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--neon-fuchsia) !important;
    background: rgba(112, 48, 239, 0.05) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4), 0 0 20px rgba(255, 0, 127, 0.15);
}

.project-card .format-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 5;
}

/* Custom Confirm Modal */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.confirm-modal {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 0, 127, 0.3);
    border-radius: 28px;
    padding: 40px 30px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 0, 127, 0.1);
    transform: translateY(0);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-icon {
    font-size: 3.5rem;
    color: var(--neon-fuchsia);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255,0,127,0.5));
}

.confirm-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: white;
    margin-bottom: 15px;
    font-weight: 700;
}

.confirm-text {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-actions .btn {
    flex: 1;
}

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

/* Cloud Storage Success Banner */
.cloud-storage-status {
    margin-bottom: 30px;
    border: 1px solid rgba(126, 34, 206, 0.4);
    background: rgba(126, 34, 206, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border-radius: 20px;
}

.warning-icon {
    font-size: 2.5rem;
    color: #FF9900;
    filter: drop-shadow(0 0 10px rgba(255, 153, 0, 0.3));
    flex-shrink: 0;
}

.warning-title {
    color: white;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    margin-bottom: 6px;
}

.warning-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.warning-text strong {
    color: white;
    font-weight: 600;
}
.badge-default { background: rgba(255,255,255,0.1); color: white; }
.badge-ebook { background: linear-gradient(135deg, #7030EF, #DB1FFF); color: white; }
.badge-leadmagnet { background: linear-gradient(135deg, #FF007F, #FF00FF); color: white; }
.badge-infoproducto { background: linear-gradient(135deg, #00d2ff, #3a7bd5); color: white; }
.badge-recetario { background: linear-gradient(135deg, #f093fb, #f5576c); color: white; }
.badge-guia { background: linear-gradient(135deg, #00ff7f, #00a8ff); color: #05050a; }

.project-card .status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    background: rgba(0, 255, 127, 0.15);
    color: #00ff7f;
    padding: 2px 8px;
    border-radius: 100px;
    border: 1px solid rgba(0, 255, 127, 0.2);
}

.project-card .status-finalized {
    background: rgba(112, 48, 239, 0.2);
    color: #DB1FFF;
    border-color: rgba(219, 31, 255, 0.3);
}

.project-card h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.25;
    margin: 15px 0 10px 0 !important; /* Espacio para el badge arriba */
}

.project-card .btn-delete {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    transition: all 0.3s;
}

.project-card:hover .btn-delete {
    opacity: 1;
}

.project-card .btn-delete:hover {
    background: #ff4d4d;
    color: white;
}

/* Custom Scrollbars for PC users without mouse */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--grad-fuchsia-violet);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
    border: 2px solid rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-fuchsia);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.6);
}

/* Gateway Cards Styles */
.style-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255,255,255,0.02) !important;
}

.style-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--neon-fuchsia) !important;
    background: rgba(255,255,255,0.06) !important;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 30px rgba(255,0,127,0.15);
}

.style-card:active {
    transform: scale(0.98);
}

.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 600px) {
    .flipbook {
        width: 320px;
        height: 480px;
    }
    .page {
        padding: 30px;
        font-size: 0.95rem;
    }
    .page-cover h1 { font-size: 1.8rem; }
}

/* Animaciones Premium para Portada */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(0.98); }
}
/* Shop Modal Premium Styles */
.credits-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.credits-shop-container {
    background: linear-gradient(180deg, rgba(20, 20, 30, 0.9) 0%, rgba(10, 10, 15, 1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: clamp(25px, 5vw, 50px);
    max-width: 1100px;
    width: 100%;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8), 0 0 50px rgba(112, 48, 239, 0.1);
    margin: auto;
}

.shop-header {
    text-align: center;
    margin-bottom: 40px;
}

.shop-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.shop-header p {
    color: var(--text-muted);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    max-width: 500px;
    margin: 0 auto;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.plan-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 35px 25px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.plan-card.featured {
    border: 2px solid var(--neon-violet);
    background: rgba(112, 48, 239, 0.05);
    box-shadow: 0 0 30px rgba(112, 48, 239, 0.15);
}

.plan-card.featured:hover {
    box-shadow: 0 0 50px rgba(112, 48, 239, 0.3);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 25px;
    background: var(--neon-fuchsia);
    color: white;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.plan-card.featured .plan-badge {
    background: var(--neon-violet);
}

.plan-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: white;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-price {
    font-size: 2.2rem;
    font-weight: 900;
    color: white;
    margin: 20px 0 10px;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.plan-price span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.plan-features {
    list-style: none;
    margin: 20px 0;
    padding: 0;
    flex: 1;
}

.plan-features li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.plan-features li ion-icon {
    color: #00ff7f;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.plan-card .btn {
    margin-top: auto;
    height: 54px;
    font-size: 1rem;
}

/* Wide Annual Plan Card */
.annual-plan-card {
    grid-column: 1 / -1;
    background: linear-gradient(90deg, rgba(0, 255, 127, 0.05) 0%, rgba(0, 168, 255, 0.05) 100%);
    border: 1px solid rgba(0, 255, 127, 0.3);
    padding: 30px 40px;
    border-radius: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    position: relative;
    overflow: hidden;
}

.annual-plan-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 255, 127, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.annual-plan-info h3 {
    color: #00ff7f !important;
    font-size: 1.6rem !important;
}

.annual-plan-price {
    text-align: right;
}

.annual-plan-price .amount {
    font-size: 2.8rem;
    font-weight: 900;
    color: white;
    line-height: 1;
}

.annual-plan-price .currency {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.annual-btn-group {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

@media (max-width: 900px) {
    .annual-plan-card {
        flex-direction: column;
        text-align: center;
        padding: 40px 30px;
    }
    .annual-plan-price {
        text-align: center;
    }
    .annual-btn-group {
        justify-content: center;
    }
}

/* Coupon & Support Section */
.shop-footer-meta {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.coupon-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 24px;
}

.coupon-input-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.coupon-input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0 15px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.coupon-input-group input:focus {
    border-color: var(--neon-fuchsia);
}

@media (max-width: 768px) {
    .shop-footer-meta {
        grid-template-columns: 1fr;
    }
    .credits-shop-container {
        padding: 30px 20px;
    }
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate-slow {
    animation: rotate-slow 12s infinite linear;
}
