/* --- VARIABLES Y RESET BÁSICO --- */
:root {
    --bg-color: #222222;
    --card-bg: #333333;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --accent-color: #ffffff;
    --border-color: #555555;
    --success-color: #4ade80;
    --error-color: #f87171;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-image: url(https://w.wallhaven.cc/full/21/wallhaven-2119yx.jpg);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

h1 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 40px;
    font-weight: bold;
    font-size: 2.5rem;
    /* Grande en PC */
    letter-spacing: -1px;
}

.btn-principal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--accent-color);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    /* Para evitar saltos al hacer hover */
}

/* En móvil, el botón volver a veces se ve mejor centrado o full width */
.btn-principal:hover {
    background-color: rgba(100, 100, 100, 0.77);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.btn-principal i,
button i {
    margin-right: 8px;
}

button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: 1px solid var(--accent-color);
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

button:hover {
    background-color: #e6e6e6;
    transform: translateY(-2px);
}

button.secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

button.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--accent-color);
}

::placeholder {
    color: #777;
}

.result-box {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-family: "Courier New", Courier, monospace;
    min-height: 40px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.status-info {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.status-info strong {
    color: var(--text-color);
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 25px;
    padding: 0 10px;
    grid-template-columns: repeat(6, 1fr);
}

.card {
    background-color: rgba(51, 51, 51, 0.6);
    border-radius: 8px;
    padding: 25px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: none;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s;

    grid-column: span 2;
}

.card:hover {
    border-color: var(--accent-color);
}

.card h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 20px;
}

.card p {
    color: var(--text-secondary);
}

@media (min-width: 1025px) {
    .card:last-child:nth-child(3n + 1) {
        grid-column: span 6;
    }
    .card:nth-last-child(2):nth-child(3n + 1),
    .card:last-child:nth-child(3n + 2) {
        grid-column: span 3;
    }
}


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

    .card {
        grid-column: auto;
    }

    .card:last-child:nth-child(odd) {
        grid-column: span 2;
    }
}

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

    .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card {
        grid-column: span 1;
    }

    .card:last-child:nth-child(odd),
    .card:last-child:nth-child(3n + 1),
    .card:nth-last-child(2):nth-child(3n + 1) {
        grid-column: auto;
    }

    .input-group {
        display: flex;
        flex-direction: column;
    }

    .btn-principal {
        margin-left: 0;
        width: 100%;
    }
}

/* --- ESTILOS DEL MODAL (VENTANA EMERGENTE) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.modal-content {
    border: 1px solid var(--accent-color);
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    text-align: center;
    position: relative;
    background-color: rgba(30, 30, 30, 0.9);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
    overflow-y: auto;
}

.modal-content img {
    width: 100%;
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    height: auto;
    border-radius: 4px;
    margin-top: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--text-secondary);
    font-size: 30px;
    line-height: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.close-btn:hover {
    color: var(--accent-color);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

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