/* ===========================
   ESTILO GLOBAL PREMIUM OSCURO
   =========================== */

:root {
    --bg-dark: #050509;
    --bg-panel: #111119;
    --bg-panel-light: #181822;
    --text-main: #f2f2f5;
    --text-muted: #9a9ab0;

    --btn-blue: #1e88e5;
    --btn-blue-hover: #42a5f5;
    --btn-blue-active: #1565c0;

    --btn-green: #43a047;
    --btn-green-hover: #66bb6a;
    --btn-green-active: #2e7d32;

    --btn-orange: #fb8c00;
    --btn-orange-hover: #ffa726;
    --btn-orange-active: #ef6c00;

    --btn-grey: #616161;
    --btn-grey-hover: #757575;
    --btn-grey-active: #424242;

    --transition: 0.25s ease;
}

* { box-sizing: border-box; }

body {
    background: radial-gradient(circle at top, #181828 0, #050509 55%);
    color: var(--text-main);
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
}

.ace_placeholder {
    position: absolute;
    top: 10px;
    left: 14px;
    color: #8a8aa5;     /* gris oscuro frío */
    font-size: 15px;
    font-style: italic;
    pointer-events: none;
    opacity: 0.75;
    transition: opacity 0.25s ease;
}

#uploadBtn {
    padding: 4px 8px !important;      /* más pequeño */
    font-size: 12px !important;       /* más compacto */
    border-radius: 6px !important;
    background: #ffcc00 !important;   /* amarillo fuerte, cero pastel */
    color: #000 !important;           /* contraste perfecto */
    border: none !important;
    transform: scale(0.90);           /* aún más pequeño */
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#uploadBtn:hover {
    background: #ffdb4d !important;   /* amarillo más claro al pasar */
    transform: scale(0.94);
}

.srp-header {
    width: 100%;
    padding: 20px 0 10px;
    display: flex;
    justify-content: center;
}

.srp-grid {
    display: grid;
    grid-template-columns: auto 1fr; /* LOGO | TEXTO */
    align-items: center;
    gap: 16px;
    max-width: 900px;
}

/* LOGO */
.srp-logo {
    width: 68px;
    height: auto;
    display: block;
}

/* TÍTULO */
.srp-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

/* SUBTÍTULO */
.srp-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    opacity: 0.75;
    line-height: 1.4;
}

/* ===========================
   MODAL LOGIN PREMIUM
   =========================== */

.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    pointer-events: none;

    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;

    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
}

/* Caja del login */
.login-box {
    background: rgba(20, 20, 30, 0.55);
    backdrop-filter: blur(12px);
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(255, 120, 180, 0.25);
    text-align: center;
    width: 300px;
    border: 1px solid rgba(255,255,255,0.12);
}

/* Título */
.login-box h2 {
    margin: 0 0 15px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Input premium */
.login-box input {
    width: 100%;
    padding: 12px;
    margin: 12px 0;
    border-radius: 10px;

    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    color: white;

    font-size: 1rem;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.login-box input:focus {
    border-color: #ff77c8;
    background: rgba(255,255,255,0.15);
}

/* Botones */
.login-box .header-btn {
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
}

/* Error */
.login-error {
    color: #ff6b6b;
    margin-top: 10px;
    font-size: 0.85rem;
    min-height: 18px;
}


.logout-btn {
    margin-left: 10px;
    background: #ff4d4d;
}

.logout-btn:hover {
    background: #ff2b2b;
}



.status-badge {
    position: fixed;
    top: 15px;
    right: 15px;
    background: #444;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0.85;
    z-index: 9999;
    font-family: Arial, sans-serif;
    transition: background 0.3s ease;
}

.status-badge.private {
    background: #e91e63; /* Rosa Mascoalba */
    font-weight: bold;
}



/* ===========================
   TÍTULO PREMIUM
   =========================== */

.tool-title h1 {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-title h1 .subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.tool-title h1 {
    text-align: center;
    width: 100%;
}

/* ===========================
   CONTENEDOR PRINCIPAL
   =========================== */

.tool-container {
    width: 100%;
    max-width: 1280px;
    margin: 40px auto;
    padding: 24px 20px 28px;
    background: linear-gradient(145deg, #111119, #151521);
    border-radius: 18px;
    box-shadow: 0 0 40px rgba(0,0,0,0.7);
}

/* ===========================
   LAYOUT LATERAL (POR DEFECTO)
   =========================== */

body.layout-side .editor-output-wrapper {
    display: flex;
    gap: 20px;
    position: relative;
}

body.layout-side .editor-section {
    width: 60%;
}

body.layout-side .output-section {
    width: 40%;
}

body.layout-side .editor-output-wrapper::after {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 60%;
    width: 2px;
    background: linear-gradient(to bottom, #1e88e5, #fb8c00);
    opacity: 0.35;
    border-radius: 2px;
}

/* ===========================
   TEXTAREA PREMIUM
   =========================== */

.editor-section textarea {
    width: 100%;
    height: 480px;
    background: radial-gradient(circle at top left, #202034 0, #14141f 55%);
    border: 1px solid #2b2b3a;
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text-main);
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    resize: none;
}

/* ===========================
   BOTONES PREMIUM
   =========================== */

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex: 0 0 auto;
}

.btn-blue { background: var(--btn-blue); }
.btn-blue:hover { background: var(--btn-blue-hover); }

.btn-green { background: var(--btn-green); }
.btn-green:hover { background: var(--btn-green-hover); }

.btn-orange { background: var(--btn-orange); }
.btn-orange:hover { background: var(--btn-orange-hover); }

.btn-grey { background: var(--btn-grey); }
.btn-grey:hover { background: var(--btn-grey-hover); }

.editor-section .buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

/* ===========================
   IFRAME
   =========================== */

.output-section iframe {
    width: 100%;
    height: 480px;
    background: #050509;
    border: 1px solid #2b2b3a;
    border-radius: 14px;
}

/* ===========================
   MODO VERTICAL
   =========================== */

body.layout-vertical .editor-output-wrapper {
    display: block;
}

body.layout-vertical .editor-section,
body.layout-vertical .output-section {
    width: 100%;
}

body.layout-vertical textarea,
body.layout-vertical iframe {
    height: 300px;
}

/* ===========================
   BOTÓN FLOTANTE
   =========================== */

.floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e88e5, #fb8c00);
    color: white;
    font-size: 26px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0,0,0,0.6);
}

.fullscreen-btn {
    right: 90px;
    background: linear-gradient(135deg, #43a047, #1e88e5);
}

body.layout-vertical .buttons {
    margin-bottom: 20px;
}

.output-section iframe {
    color-scheme: dark;
}

/* ===========================
   OVERLAY MODO PROFESIONAL
   =========================== */

.pro-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
}

.pro-box {
    background: #111;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
    border: 1px solid #333;
    pointer-events: auto;

    animation: proGlow 0.45s ease-out;
}

.pro-box h2 {
    margin-bottom: 10px;
    font-size: 26px;
    color: #fff;
}

.pro-box p {
    margin-bottom: 20px;
    color: #aaa;
}

.pro-btn {
    padding: 12px 24px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e88e5, #fb8c00);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.pro-btn:hover {
    transform: scale(1.05);
}

/* ===========================
   ANIMACIÓN ILUMINACIÓN
   =========================== */

@keyframes proGlow {
    0% {
        transform: scale(0.92);
        opacity: 0;
        box-shadow: 0 0 0px rgba(255, 255, 255, 0);
    }
    60% {
        transform: scale(1.03);
        opacity: 1;
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.08);
    }
}

/* ===========================
   SCROLL GLOBAL NEGRO PREMIUM
=========================== */

html, body {
    scrollbar-width: thin;
    scrollbar-color: #1e1e1e #000; /* Firefox */
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #1e1e1e;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* ===========================
   INDICADOR DE AUTOGUARDADO PREMIUM
=========================== */
#saveIndicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(15, 15, 25, 0.85);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.08);

    /* Glow Mascoalba */
    box-shadow: 0 0 12px rgba(30,136,229,0.35),
                0 0 22px rgba(251,140,0,0.25);
}

#saveIndicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   VISTA PREVIA RESPONSIVE
=========================== */

.responsive-preview {
    transition: width 0.35s ease, height 0.35s ease, transform 0.35s ease;
    margin: 0 auto;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
}

/* Botones pequeños para vista previa */
.btn-preview {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    flex: 0 0 auto;
    height: 28px;
    line-height: 20px;
}

/* Botones pequeños de snippets */
#snippetButtons {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

#snippetButtons .btn-preview {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    height: 28px;
    line-height: 20px;
}

/* ===========================
   LED DE ESTADO MASCOALBA
   =========================== */

.led-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* LED base */
.led-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #333;
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
    transition: 0.25s ease;
    display: inline-block;
    margin-top: 4px;
}

/* LED OK (verde premium) */
.led-ok {
    background: #00ff6a;
    box-shadow: 0 0 10px rgba(0,255,106,0.7);
}

/* LED ERROR (rojo premium) */
.led-error {
    background: #ff3b3b;
    box-shadow: 0 0 10px rgba(255,59,59,0.7);
}

.music-premium {
    background: rgba(20,20,30,0.85);
    padding: 14px;
    border-radius: 12px;
    margin-top: 15px;
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);
    box-shadow: 0 0 18px rgba(0,255,180,0.25);
}

.music-info {
    color: #00ffb4;
    font-size: 14px;
    margin-bottom: 8px;
    text-shadow: 0 0 6px rgba(0,255,180,0.6);
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-btn {
    background: rgba(0,255,180,0.15);
    border: 1px solid rgba(0,255,180,0.35);
    color: #00ffb4;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.25s ease;
}

.music-btn:hover {
    background: rgba(0,255,180,0.25);
    transform: scale(1.1);
}

#musicSeek, #musicVolume {
    flex: 1;
    accent-color: #00ffb4;
}

:host {
    display: block;
    background: #000;
    min-height: 100vh;
    padding: 20px;
    font-family: "Poppins", sans-serif;
    color: #fff;
}

/* Título */
header {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #ffffff; /* Blanco */
}

/* Contenedor de tarjetas */
.container {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}


/* Tarjeta */
.card {
    background: rgba(255,255,255,0.12); /* Gris premium */
    border-radius: 14px;
    padding: 20px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.18);
    text-align: center;
    transition: 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 18px rgba(255,255,255,0.15);
}

/* Icono */
.icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* Título de tarjeta */
.title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ff4fcf; /* Rosa */
}

/* Descripción */
.desc {
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: #ffffff; /* Blanco */
    opacity: 1;
}

/* Contenedor general */
.apps, section.apps {
    width: 100%;
    max-width: 1400px; /* suficiente para 4 tarjetas */
    margin: 0 auto;
    padding: 20px;
}

.apps-title {
    color: #ffffff;      /* Blanco */
    text-align: center;  /* Centrado */
    font-size: 2.2rem;   /* Más grande */
    margin-bottom: 25px; /* Espacio inferior */
}




/* Contenedor de tarjetas */
.container {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Tarjeta con altura igualada */
.card {
    background: rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 20px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.18);
    text-align: center;
    transition: 0.25s ease;

    display: flex;
    flex-direction: column;
    justify-content: space-between; /* botón abajo */
    height: 100%;
}

/* Contenido interno */
.card-content {
    flex: 1;
}

/* Icono */
.icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* Título */
.title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ff4fcf;
}

/* Descripción */
.desc {
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: #ffffff;
    opacity: 1;
}

/* BOTÓN NEGRO → AMARILLO AL PULSAR */
.card .btn {
    display: block;
    width: 100%;
    padding: 12px 0;
    border-radius: 999px;
    background: #000000; /* Negro */
    color: #ffffff; /* Blanco */
    font-weight: 600;
    text-decoration: none;
    margin-top: 20px;
    transition: 0.25s ease;
    text-align: center;
}

/* Hover */
.card .btn:hover {
    background: #111111;
    transform: translateY(-2px);
}

/* Active (pulsado) */
.card .btn:active {
    background: #fdd835; /* Amarillo */
    color: #000000; /* Texto negro */
    transform: scale(0.96);
}



/* Colores originales tipo estilos.css (si los usas en otras tarjetas) */
.card-blue   { background: var(--card-blue); }
.card-green  { background: var(--card-green); }
.card-orange { background: var(--card-orange); }
.card-red    { background: var(--card-red); }
.card-purple { background: var(--card-purple); }
.card-yellow { background: var(--card-yellow); }

/* Hover de colores */
.card-blue:hover   { background: #2196f3; }
.card-green:hover  { background: #4caf50; }
.card-orange:hover { background: #ffa726; }
.card-red:hover    { background: #ef5350; }
.card-purple:hover { background: #ab47bc; }
.card-yellow:hover { background: #ffee58; }



/* ===========================
   BOTONES ORIGINALES RECUPERADOS
   =========================== */

.btn {
    all: unset; /* Limpia cualquier estilo global que esté pisando tus botones */
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 8px 14px;      /* 🔥 Tamaño más pequeño */
    font-size: 13px;        /* 🔥 Texto más pequeño */
    border-radius: 999px;

    cursor: pointer;
    color: white;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
    flex: 0 0 auto;
    transition: 0.25s ease;
    text-decoration: none;
}

/* Colores EXACTOS como antes */
.btn-blue { background: var(--btn-blue) !important; }
.btn-blue:hover { background: var(--btn-blue-hover) !important; }

.btn-green { background: var(--btn-green) !important; }
.btn-green:hover { background: var(--btn-green-hover) !important; }

.btn-orange { background: var(--btn-orange) !important; }
.btn-orange:hover { background: var(--btn-orange-hover) !important; }

.btn-grey { background: var(--btn-grey) !important; }
.btn-grey:hover { background: var(--btn-grey-hover) !important; }




/* Evitar que .tool-container afecte a esta sección */
.tools-section * {
    box-sizing: border-box;
}

/* ============================================
   NOTCH iPhone 14 Pro (Dynamic Island)
   ============================================ */

body.view-mobile #outputFrame::before,
#outputFrame[style*="max-width: 430px"]::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;          /* ancho del notch */
    height: 35px;          /* alto del notch */
    background: #000;
    border-radius: 20px;
    z-index: 9999;
    box-shadow:
        0 0 8px rgba(0,0,0,0.4),
        0 0 20px rgba(0,0,0,0.25);
}

/* Asegurar que el iframe permite pseudo-elementos */
body.view-mobile #outputFrame,
#outputFrame[style*="max-width: 430px"] {
    position: relative !important;
}

/* ============================================
   CONTENEDOR DEL MÓVIL (MARCO EXTERIOR)
   ============================================ */

body.view-mobile #outputFrame,
#outputFrame[style*="max-width: 430px"] {
    position: relative !important;
    width: 100% !important;
    max-width: 430px !important;
    height: 100% !important;
    max-height: calc(100vh - 220px) !important;
    margin: 0 auto !important;
    display: block !important;

    /* MARCO DEL MÓVIL */
    padding: 18px; /* grosor del marco */
    background: #0a0a0a !important; /* color del marco */
    border-radius: 45px !important; /* forma del móvil */
    box-shadow: 0 0 45px rgba(0,0,0,0.55) !important;
    overflow: hidden !important;
}

/* ============================================
   PANTALLA INTERIOR
   ============================================ */

body.view-mobile #outputFrame iframe,
#outputFrame[style*="max-width: 430px"] iframe {
    border-radius: 32px !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* ============================================
   NOTCH / DYNAMIC ISLAND
   ============================================ */

body.view-mobile #outputFrame::before,
#outputFrame[style*="max-width: 430px"]::before {
    content: "";
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 35px;
    background: #000;
    border-radius: 20px;
    z-index: 9999;
    box-shadow:
        0 0 8px rgba(0,0,0,0.4),
        0 0 20px rgba(0,0,0,0.25);
}




/* ============================
   VISTA TABLET — AJUSTADA
   ============================ */

body.view-tablet #outputFrame,
#outputFrame[style*="max-width: 900px"] {
    width: 100% !important;
    max-width: 900px !important;
    height: 100% !important;
    max-height: calc(100vh - 140px) !important;
    margin: 0 auto !important;

    border-radius: 20px !important;
    overflow: hidden !important;
    background: #000 !important;
    border: 6px solid #000 !important;
    box-shadow: 0 0 30px rgba(0,0,0,0.4) !important;
}

/* ============================
   VISTA ESCRITORIO
   ============================ */

body.view-desktop #outputFrame {
    width: 100% !important;
    height: 465px !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.footer-mascoalba {
    background: radial-gradient(circle at top, #181828 0, #050509 55%) !important;
    color: #ffffff;
    padding: 25px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.15);
}



.footer-mascoalba a {
    color: #ff66cc;
    text-decoration: none;
    font-weight: 600;
}

.footer-mascoalba a:hover {
    text-decoration: underline;
}


#menu03,
.tools-section,
.tools-title {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* EFECTO BORROSO */
#blur-overlay {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(12px);
  background: rgba(0,0,0,0.45);
  z-index: 999;
  display: none;
}

/* YOUTUBE */
.youtube-wrapper {
  max-width: 900px;
  margin: 40px auto;
  padding: 25px;
  background: #111;
  border-radius: 14px;
  text-align: center;
}

.youtube-wrapper iframe {
  width: 100%;
  height: 500px;
  border-radius: 14px;
  border: none;
}

.youtube-warning {
  color: #ccc;
  font-size: 1rem;
  padding: 20px;
}

/* ===========================
   GRID RESPONSIVE
=========================== */
.tools-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 600px) {
  .tools-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .tools-container {
    grid-template-columns: repeat(7, 1fr);
  }

  .tools-container > *:nth-child(7n + 8) {
    grid-column: 1 / 2;
  }
}

