/* =========================
    GLOBAL
========================= */
body {
    background: linear-gradient(to bottom, #f8fbff, #eef3f9);
    font-family: Arial, sans-serif;
    margin: 0;
}

/* =========================
    ANIMATIONS
========================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================
    COMPONENTS
========================= */

.arrow {
    color: #999;
    font-size: 20px;
}

.btn {
    background: linear-gradient(135deg, #007bff, #00c6ff);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 16px;
    color: white;
    cursor: pointer;

    transition: 0.2s;
}

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

/* =========================
    CATEGORY GRID (NEW UI)
========================= */

.category {
    margin-top: 80px;   /* 🔥 más separación vertical */
    animation: fadeIn 0.5s ease;
    text-align: center;
}

.category-icon {
    width: 28px;
    height: 28px;
}

.category h2 {
    font-size: 22px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0;
    justify-content: start;
}

.tool-icon {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin-bottom: 2px;
    display: block;
    opacity: 0.95;
}

.compare-box {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.container {
    display: none;
}

.container.active {
    display: block;
}

.container form {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-file-upload {
    display: inline-block;
    padding: 12px 20px;
    cursor: pointer;
    background: #f1f1f1;
    border-radius: 8px;
    border: 1px solid #ccc;
    transition: 0.3s;
}

.custom-file-upload:hover {
    background: #ddd;
}

#delete-pages-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* =========================
    DROP AREA
========================= */
.drop-area {
    align-items: center;
    background: white;
    border: 2px dashed #ccc;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    height: 220px;
    justify-content: center;
    transition: all 0.3s ease;
    width: 420px;
}

.drop-area:hover {
    background: #f4f8ff;
    border-color: #007bff;
    transform: scale(1.02);
}

/*===========================
FEEDBACK, DONATIONS
=============================*/

    .top-actions {
    position: absolute;
    top: 15px;
    right: 150px;
    display: flex;
    gap: 10px;
}

    .action-btn {
    background: #333;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

    .action-btn:hover {
    background: #555;
}

.close-btn {
    margin-top: 15px;
    background: #ccc;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.close-btn:hover {
    background: #999;
}

/* =========================
    DONATION BUTTON
========================= */

.donation-box {
    max-width: 500px;
    margin: 80px auto;
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.donation-box h3 {
    margin-bottom: 10px;
}

.donation-box p {
    color: #666;
    font-size: 14px;
}

.donate-btn {
    margin-top: 15px;
    background: linear-gradient(135deg, #ff7a18, #ffb347);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    cursor: pointer;
}

.donate-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.donate-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 15px;
    width: 160px;
    text-align: center;
    border: 1px solid #eee;
}

.donate-card h4 {
    margin-bottom: 5px;
}

.donate-card button,
.donate-card a {
    display: block;
    margin-top: 10px;
    background: #eee;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    color: black;
    border: none;
    cursor: pointer;
}

.donate-card button:hover,
.donate-card a:hover {
    background: #e0e0e0;
}

/* =========================
    FILE LIST
========================= */
.file-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    font-size: 14px;
    margin: 5px auto;
    padding: 8px 15px;
    width: 320px;
}

.file-list {
    margin-top: 10px;
    max-height: 120px;
    overflow-y: auto;
    text-align: center;
    width: 100%;
}

.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.file-name {
    margin-top: 10px;
    max-width: 420px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.file-name span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.file-size {
    color: #666;
    font-weight: bold;
}

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

.footer {
    margin-top: 80px;
    background: #ffffff;
    border-top: 1px solid #eee;
    padding: 40px 20px 20px;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand h3 {
    margin-bottom: 5px;
}

.footer-brand p {
    color: #666;
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 15px;
}

.footer-links a {
    text-decoration: none;
    color: #555;
    font-size: 14px;
}

.footer-links a:hover {
    color: #007bff;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    font-size: 13px;
    color: #999;
}

/* =========================
    HEADER / HERO
========================= */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-size: 24px;
    font-weight: bold;
    padding: 20px;
    text-align: center;
}

.hero {

    text-align: center;
    margin-top: 30px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 18px;
    color: #666;
}

.hero-actions {
    margin-top: 20px;
}

.hero-logo {
    height: 200px;   /* 🔥 MÁS GRANDE */
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.15));
}

    @keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}



/* =========================
    ADD IMAGES
========================= */
#images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

#images-preview img {
    width: 120px;
    border-radius: 6px;
}

.draggable {
    cursor: grab;
    text-align: center;
}

/* =========================
    LABELS / TEXT
========================= */
.highlight {
    color: #28a745;
}

.label {
    color: #888;
    font-size: 12px;
}

.reduction {
    color: #007bff;
    font-weight: bold;
    margin-top: 10px;
}

.value {
    font-size: 20px;
    font-weight: bold;
}
/* =========================
    LANGUAGE
========================= */
#google_translate_element {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 999;
}
/* =========================
    LOADER
========================= */
.loader {
    align-items: center;
    background: rgba(255,255,255,0.9);
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 999;
}

.loader-icon {
    animation: spin 2s linear infinite;
    font-size: 40px;
    margin-bottom: 10px;
}

.spinner {
    animation: spin 1s linear infinite;
    border: 5px solid #ddd;
    border-radius: 50%;
    border-top: 5px solid #007bff;
    height: 50px;
    margin-bottom: 15px;
    width: 50px;
}

.preview-loader {
    align-items: center;
    color: #666;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 30px;
}

/* =========================
    MODAL
========================= */
.modal {
    display: none;
    position: fixed;


    top: 0;
    left: 0;


    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.6);

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

    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    width: 300px;
}

.modal.hidden {
    display: none !important;
}

.btn-secondary {
    margin-top: 10px;
    background: transparent;
    border: 2px solid #ccc;
    color: #333;

    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;

    transition: 0.2s;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #999;
}

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

/*===========================
    NAVBAR
=============================*/

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

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

.logo-text {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 1px;
}

.brand-name {
    font-weight: bold;
    font-size: 18px;
}

.logo img {
    height: 40px;
    object-fit: contain;
}

.nav-actions {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: #eee;
    cursor: pointer;
}

.nav-btn.primary {
    background: linear-gradient(135deg, #007bff, #00c6ff);
    color: white;
}

/* =========================
    PAGES
========================= */
#pages-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
    max-width: 800px;
}

.page {
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    width: 120px;
}

.page:hover {
    transform: scale(1.05);
}

.selected {
    border: 2px solid #007bff;
}

/* =========================
    PROGRESS
========================= */
.progress-bar {
    background: #eee;
    border-radius: 10px;
    height: 10px;
    margin-top: 20px;
    overflow: hidden;
    width: 100%;
}

#progressFill {
    background: linear-gradient(90deg, #007bff, #00c6ff);
    height: 100%;
    transition: width 0.3s;
    width: 0%;
}

#reorder-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.draggable {
    cursor: grab;
    text-align: center;
}

.draggable:active {
    cursor: grabbing;
}

.main-text {
    font-weight: bold;
    font-size: 18px;
}

.sub-text {
    color: gray;
    font-size: 14px;
}

/* ROTATE GRID */
#rotate-pages-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

#rotate-pages-container div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =========================
    TOOLS
========================= */
.tool {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #f0f0f0;

    padding: 18px 14px;

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

    text-align: center;
    cursor: pointer;

    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: all 0.2s ease;

}

.tool:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.10);
    filter: brightness(1.05);
}

.tool:hover .tool-icon {
    transform: scale(1.05);
    transition: 0.2s;
}


.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    
    gap: 25px;  /* 🔥 AUMENTA separación */
    
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;  /* 🔥 margen lateral */
}

.tool h3 {
    font-size: 14px;
    margin: 4px 0 0;
    color: #1a73e8;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.tool p {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.tools {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

/* =========================
    UPLOAD
========================= */
.upload-card {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.upload-content {
    text-align: center;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.upload-sub {
    color: #777;
    font-size: 14px;
}

.upload-title {
    font-size: 18px;
    font-weight: bold;
}

.upload-area {
    border: 2px dashed #ccc;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    transition: 0.3s;
}

.upload-area.dragover {
    background-color: #f0f8ff;
    border-color: #007bff;
}

.upload-box-content .icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

/* =========================
    UTILS
========================= */
.hidden {
    display: none;
}

/* =========================
    ZOOM PREVIEW
========================= */
.zoom-preview {
    background: white;
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    left: 50%;
    padding: 10px;
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    z-index: 9999;
}

.zoom-preview img {
    border-radius: 6px;
    width: 100%;
}

/* =========================
    CATEGORY COLORS
========================= */

.convertir { background: #F7F3FF; }
.optimizar { background: #FFF7ED; }
.seguridad { background: #EEF8F2; }
.organizar { background: #F3F8FF; }

.organizar h3 { color: #1A73E8; }
.convertir h3 { color: #6C3BD1; }
.optimizar h3 { color: #E67E22; }
.seguridad h3 { color: #27AE60; }