/* =========================================================
   CONVERTIDOR DE IMÁGENES
   DISEÑO MODERNO
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@500;600;700;800&display=swap");

/* =========================================================
   RESET
   ========================================================= */

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

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

body {
    min-height: 100vh;
    font-family: "Inter", Arial, sans-serif;
    color: #ffffff;
    background:
        radial-gradient(circle at 15% 15%, #00fbff1f, transparent 30%),
        radial-gradient(circle at 85% 80%, #a855f71f, transparent 30%),
        linear-gradient(135deg, #070b12 0%, #0b101a 45%, #090d16 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* =========================================================
   FONDO DECORATIVO
   ========================================================= */

body::before {
    content: "";
    position: fixed;
    width: 500px;
    height: 500px;
    top: -250px;
    left: -250px;
    background: #00fbff14;
    filter: blur(100px);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    width: 500px;
    height: 500px;
    right: -250px;
    bottom: -250px;
    background: #a855f714;
    filter: blur(100px);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* =========================================================
   HEADER
   ========================================================= */

.header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-container {
    width: min(1200px, 92%);
    min-height: 70px;
    margin: auto;
    padding: 0 clamp(8px, 2vw, 25px);

    display: flex;
    align-items: center;
    gap: clamp(15px, 6vw, 100px);
}

.logo {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 12px);

    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: clamp(14px, 1.5vw, 18px);
    white-space: nowrap;

    min-width: 0;
}

.logo img {
    width: clamp(34px, 4vw, 42px);
    height: clamp(34px, 4vw, 42px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.header-about {
    margin-left: auto;
    flex-shrink: 0;

    width: clamp(40px, 4vw, 50px);
    height: clamp(40px, 4vw, 50px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 0;
    border-radius: 10px;

    background: transparent;
    color: #fff;

    font-family: inherit;
    font-size: clamp(15px, 1.6vw, 18px);

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.header-about:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.header-about i {
    font-size: inherit;
}

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

.container {
    width: min(1100px, 92%);
    margin-top: 55px;
    margin-bottom: 30px;
    padding: 35px;
    background: #0f172a94;
    border: 1px solid #ffffff14;
    border-radius: 28px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 25px 80px #00000059;
    animation: containerAppear 0.6s ease;
}

@keyframes containerAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   TITULO
   ========================================================= */

h1 {
    font-family: "Poppins", sans-serif;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;

    background: linear-gradient(90deg, #00fbff, #7dd3fc, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container::before {
    content: "Convierte tus imágenes directamente desde tu navegador";
    display: block;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
    margin-bottom: 35px;
}

/* =========================================================
   AREA DE SUBIDA
   ========================================================= */

.upload-box {
    position: relative;
    width: 100%;
    min-height: 250px;
    padding: 40px;
    border-radius: 22px;
    border: 2px dashed #00fbff59;

    background: linear-gradient(145deg, #00fbff09, #a855f709);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    overflow: hidden;

    transition:
        border-color 0.3s ease,
        background 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.upload-box::before {
    content: "↥";
    width: 70px;
    height: 70px;
    margin-bottom: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 20px;
    background: #00fbff14;
    border: 1px solid #00fbff2e;

    color: #00fbff;
    font-size: 36px;
    font-weight: 600;
}

.upload-box p {
    margin: 0;
    color: #e2e8f0;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}

.upload-box::after {
    content: "JPG • PNG • WEBP • SVG • ICO";
    position: absolute;
    bottom: 25px;
    color: #64748b;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.upload-box:hover {
    border-color: #00fbff;
    background: linear-gradient(145deg, #00fbff12, #a855f712);
    transform: translateY(-2px);
    box-shadow: 0 10px 35px #00fbff14;
}

.upload-box.dragging {
    border-color: #00fbff;
    background: #00fbff1f;
    transform: scale(1.01);
    box-shadow: 0 0 35px #00fbff2e;
}

input[type="file"] {
    display: none;
}

/* =========================================================
   CONTROLES
   ========================================================= */

select,
button {
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 600;
    transition: 0.25s ease;
}

select {
    margin-top: 25px;
    padding: 0 18px;
    color: #e2e8f0;
    background: #0f172ae6;
    border: 1px solid #00fbff40;
    outline: none;
    cursor: pointer;
}

select:hover,
select:focus {
    border-color: #00fbff;
    box-shadow: 0 0 0 3px #00fbff14;
}

button {
    margin-top: 12px;
    padding: 0 18px;
    border: 1px solid transparent;
    cursor: pointer;
}

#convertBtn {
    background: linear-gradient(135deg, #00d9df, #00fbff);
    color: #031014;
    box-shadow: 0 8px 25px #00fbff26;
}

#convertBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px #00fbff40;
}

#clearBtn {
    background: #ef444414;
    color: #f87171;
    border: 1px solid #ef444440;
    margin-top: 10px;
}

#clearBtn:hover {
    background: #ef444426;
    border-color: #ef4444;
    transform: translateY(-1px);
}

#downloadAllBtn {
    display: none;
    margin-top: 20px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    border: none;
    box-shadow: 0 8px 25px #a855f72e;
}

#downloadAllBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px #a855f74d;
}

/* =========================================================
   PREVISUALIZACIONES
   ========================================================= */

#previewContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
    margin-top: 30px;
}

.preview-box {
    position: relative;
    padding: 14px;
    background: #0f172abf;
    border: 1px solid #ffffff12;
    border-radius: 18px;
    text-align: center;
    overflow: hidden;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;

    animation: cardAppear 0.35s ease;
}

.preview-box:hover {
    transform: translateY(-4px);
    border-color: #00fbff40;
    box-shadow: 0 12px 35px #00000040;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.preview-box p {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.preview-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin: 0;
    border-radius: 12px;

    background:
        repeating-conic-gradient(
            #1e293b 0% 25%,
            #111827 0% 50%
        ) 50% / 20px 20px;
}

/* =========================================================
   DESCARGAS
   ========================================================= */

#downloadContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.download-btn {
    display: block;
    padding: 12px 16px;
    background: #22c55e1a;
    color: #4ade80;
    border: 1px solid #22c55e40;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: 0.25s ease;
}

.download-btn:hover {
    background: #22c55e2e;
    border-color: #4ade80;
    transform: translateY(-1px);
}

/* =========================================================
   INFORMACIÓN
   ========================================================= */

.info {
    margin-top: 25px;
    color: #64748b;
    text-align: center;
    font-size: 13px;
}

/* =========================================================
   ABOUT BUTTON
   ========================================================= */

.about-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #0f172ae6;
    color: #00fbff;
    border: 1px solid #00fbff59;

    backdrop-filter: blur(12px);

    font-size: 18px;
    cursor: pointer;

    transition: 0.25s ease;
    z-index: 1000;
}

.about-btn:hover {
    background: #00fbff;
    color: #061014;
    transform: scale(1.08);
    box-shadow: 0 0 25px #00fbff40;
}

/* =========================================================
   ABOUT OVERLAY
   ========================================================= */

.about-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;

    padding: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #000000c7;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;

    z-index: 2000;
}

.about-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =========================================================
   ABOUT CONTENT
   ========================================================= */

.about-content {
    position: relative;

    width: min(650px, 100%);
    max-height: 90vh;

    overflow-y: auto;

    padding: 30px;

    background: #0f172af7;
    border: 1px solid #ffffff14;
    border-radius: 24px;

    box-shadow: 0 30px 100px #0000008c;

    scrollbar-width: none;

    transform: translateY(15px) scale(0.98);
    transition: transform 0.3s ease;
}

.about-content::-webkit-scrollbar {
    display: none;
}

.about-panel.active .about-content {
    transform: translateY(0) scale(1);
}

/* =========================================================
   ABOUT HEADER
   ========================================================= */

.about-header {
    position: relative;

    display: flex;
    align-items: center;
    gap: 16px;

    padding-bottom: 22px;

    border-bottom: 1px solid #ffffff14;
}

.about-icon {
    width: 58px;
    height: 58px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background: #00fbff14;
    border: 1px solid #00fbff33;

    color: #00fbff;
    font-size: 24px;
}

.about-header h2 {
    font-family: "Poppins", sans-serif;
    color: #ffffff;
    font-size: 25px;
    margin: 0;
}

.about-header p {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 13px;
}

.about-close {
    position: absolute;
    top: 0;
    right: 0;

    width: 38px;
    height: 38px;
    min-height: 38px;

    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff0a;
    border: 1px solid #ffffff14;
    border-radius: 10px;

    color: #94a3b8;
    font-size: 16px;
}

.about-close:hover {
    background: #ef44441f;
    border-color: #ef44444d;
    color: #f87171;
    transform: none;
}

/* =========================================================
   DESCRIPCIÓN
   ========================================================= */

.about-description {
    padding: 20px 0 5px;
    text-align: center;
}

.about-description p {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.about-description span {
    color: #64748b;
    font-size: 12px;
}

.about-description strong {
    color: #00fbff;
    font-weight: 600;
}

/* =========================================================
   SECCIONES
   ========================================================= */

.about-section {
    margin-top: 25px;
    padding-top: 22px;
    border-top: 1px solid #ffffff12;
    text-align: center;
}

.about-section h3 {
    margin: 0 0 15px;
    color: #e2e8f0;
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 600;
}

.about-section h3 i {
    margin-right: 7px;
    color: #00fbff;
    font-size: 13px;
}

/* =========================================================
   ICONOS
   ========================================================= */

.links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.links a {
    position: relative;

    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #ffffff09;
    border: 1px solid #ffffff14;

    color: #94a3b8;
    text-decoration: none;

    font-size: 18px;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.links a:hover {
    background: #00fbff14;
    border-color: #00fbff59;
    color: #00fbff;
    transform: translateY(-3px);
}

/* =========================================================
   TOOLTIP
   ========================================================= */

.links a::after {
    content: attr(title);

    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);

    transform: translateX(-50%) translateY(4px);

    padding: 6px 9px;

    background: #020617;
    color: #e2e8f0;

    border: 1px solid #00fbff33;
    border-radius: 7px;

    font-size: 10px;
    font-weight: 500;

    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.links a:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    width: 100%;
    padding: 25px 20px 35px;

    text-align: center;

    color: #64748b;
    font-size: 13px;
}

.footer p {
    margin: 0;
}

.footer a {
    color: #00fbff;
    text-decoration: none;
    transition: 0.2s ease;
}

.footer a:hover {
    color: #a855f7;
}

/* =========================================================
   RESPONSIVE - HEADER
   ========================================================= */

@media (max-width: 800px) {

    .header-container {
        min-height: 62px;
        width: 94%;
        padding: 0 8px;
        gap: 15px;
    }

    .logo {
        font-size: 15px;
    }

    .logo img {
        width: 38px;
        height: 38px;
    }

    .header-about {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
}

/* =========================================================
   RESPONSIVE - TABLET / MOVIL
   ========================================================= */

@media (max-width: 700px) {

    .container {
        width: 94%;
        margin-top: 25px;
        padding: 22px;
        border-radius: 22px;
    }

    .container::before {
        font-size: 13px;
        margin-bottom: 25px;
    }

    .upload-box {
        min-height: 210px;
        padding: 25px 15px;
    }

    .upload-box::before {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .upload-box p {
        font-size: 15px;
    }

    .upload-box::after {
        bottom: 18px;
        font-size: 10px;
    }

    #previewContainer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .preview-box {
        padding: 10px;
        border-radius: 14px;
    }

    .preview-image {
        height: 120px;
    }

    .about-btn {
        right: 15px;
        bottom: 15px;
    }

    .about-panel {
        padding: 12px;
    }

    .about-content {
        width: 100%;
        max-height: 92vh;
        padding: 22px;
        border-radius: 20px;
    }

    .about-header {
        padding-right: 45px;
    }

    .about-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
        font-size: 20px;
    }

    .about-header h2 {
        font-size: 21px;
    }

    .about-section {
        margin-top: 20px;
        padding-top: 18px;
    }

    .links {
        gap: 8px;
    }

    .links a {
        width: 43px;
        height: 43px;
    }
}

/* =========================================================
   RESPONSIVE - MOVILES PEQUEÑOS
   ========================================================= */

@media (max-width: 500px) {

    .header-container {
        min-height: 60px;
        width: 96%;
        padding: 0 5px;
        gap: 10px;
    }

    .logo {
        font-size: 14px;
        gap: 8px;
    }

    .logo img {
        width: 36px;
        height: 36px;
    }

    .header-about {
        width: 40px;
        height: 40px;
        font-size: 15px;
        border-radius: 8px;
    }
}

/* =========================================================
   RESPONSIVE - PANTALLAS MUY PEQUEÑAS
   ========================================================= */

@media (max-width: 400px) {

    .header-container {
        width: 97%;
        gap: 8px;
    }

    .logo {
        font-size: 13px;
    }

    .logo img {
        width: 34px;
        height: 34px;
    }

    .header-about {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .container {
        padding: 16px;
    }

    #previewContainer {
        grid-template-columns: 1fr;
    }

    .preview-image {
        height: 180px;
    }

    h1 {
        font-size: 27px;
    }
}

/* =========================================================
   RESPONSIVE - MOVILES EXTREMADAMENTE PEQUEÑOS
   ========================================================= */

@media (max-width: 320px) {

    .header-container {
        width: 98%;
        padding: 0 3px;
        gap: 6px;
    }

    .logo {
        font-size: 12px;
        gap: 6px;
    }

    .logo img {
        width: 32px;
        height: 32px;
    }

    .header-about {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}
