/* Variables de colores corporativos */
:root {
    --corporate-blue: #1a365d;
    --corporate-dark-blue: #0f2027;
    --corporate-green: #89F20E;
    --corporate-white: #ffffff;
    --corporate-light-gray: #e2e8f0;
    --corporate-dark-gray: #4a5568;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, var(--corporate-dark-blue) 0%, var(--corporate-blue) 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 18px;
    padding: 18px 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--corporate-blue);
    margin-bottom: 6px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--corporate-dark-gray);
    font-weight: 400;
}

/* Secciones generales */
section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--corporate-blue);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--corporate-green);
}

section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--corporate-blue);
    margin-bottom: 10px;
}

/* Área de subida */
.upload-section {
    text-align: center;
}

.file-limit {
    color: var(--corporate-dark-gray);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 10px;
    padding: 21px 15px;
    margin-bottom: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f7fafc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--corporate-green);
    background: #edf2f7;
    transform: translateY(-2px);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-icon {
    font-size: 2rem;
    color: var(--corporate-green);
}

.upload-area p {
    color: #4a5568;
    font-size: 0.9rem;
}

.browse-link {
    color: var(--corporate-green);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

/* Opciones del formulario */
.form-options {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--corporate-green);
    border-color: var(--corporate-green);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
}

/* Opciones avanzadas */
.advanced-options {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
    text-align: left;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-group label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.85rem;
}

.option-group input,
.option-group select {
    padding: 7px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: border-color 0.3s ease;
}

.option-group input:focus,
.option-group select:focus {
    outline: none;
    border-color: var(--corporate-green);
}

.password-input-group {
    display: flex;
    gap: 8px;
}

.password-input-group input {
    flex: 1;
}

.password-input-group button {
    padding: 7px 10px;
    white-space: nowrap;
}

/* Botones */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    min-width: 100px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--corporate-green), #6BC200);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(137, 242, 14, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--corporate-green);
    border: 2px solid var(--corporate-green);
}

.btn-outline:hover {
    background: var(--corporate-green);
    color: white;
    transform: translateY(-2px);
}

.btn-loader {
    display: flex;
    align-items: center;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Barra de progreso */
.progress-container {
    margin-top: 14px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-text {
    font-weight: 500;
    color: #4a5568;
}

.progress-percentage {
    font-weight: 600;
    color: var(--corporate-green);
    font-size: 1rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--corporate-green), #6BC200);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #718096;
}

/* Mensajes */
.success-message,
.error-message {
    margin-top: 14px;
    padding: 12px;
    border-radius: 8px;
    text-align: left;
}

.success-message {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
}

.error-message {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #742a2a;
}

/* Información de descarga */
.download-info {
    margin-top: 10px;
}

.download-link-section,
.password-section,
.combined-link-section {
    margin-bottom: 10px;
}

.download-link-section label,
.password-section label,
.combined-link-section label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.link-display,
.password-display,
.combined-display {
    display: flex;
    gap: 6px;
    align-items: center;
}

.link-display input,
.password-display input,
.combined-display input {
    flex: 1;
    padding: 7px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    background: #f7fafc;
    color: #4a5568;
    font-family: 'Courier New', monospace;
}

.file-details {
    margin-top: 10px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.file-details p {
    margin: 3px 0;
    color: #4a5568;
    font-size: 0.8rem;
}

.file-details strong {
    color: #2d3748;
}

/* Formulario de URL */
.url-form {
    margin-bottom: 10px;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group input[type="url"] {
    flex: 1;
    min-width: 250px;
    padding: 7px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: border-color 0.3s ease;
}

.input-group input[type="url"]:focus {
    outline: none;
    border-color: var(--corporate-green);
}

/* Resultados de URL */
.url-results h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #2d3748;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.result-item {
    background: #f7fafc;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.result-label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 4px;
    font-size: 0.75rem;
}

.result-value {
    font-size: 0.8rem;
    color: #2d3748;
    word-break: break-all;
}

.status-success {
    color: #38a169;
    font-weight: 600;
}

.status-error {
    color: #e53e3e;
    font-weight: 600;
}

/* Herramientas */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
}

.tool-card {
    background: #f7fafc;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.tool-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #2d3748;
}

.tool-card p {
    color: #718096;
    margin-bottom: 10px;
    line-height: 1.4;
    font-size: 0.8rem;
}

.tool-card form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.tool-card input[type="file"] {
    padding: 6px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    background: white;
    font-size: 0.8rem;
}

/* Formularios de herramientas */
.image-converter-form,
.csv-form {
    text-align: left;
    width: 100%;
}

.form-group {
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.8rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.8rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--corporate-green);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.quality-value {
    display: inline-block;
    font-weight: 500;
    color: var(--corporate-green);
    min-width: 35px;
    text-align: center;
    font-size: 0.8rem;
}

/* Información del sistema */
.info-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f7fafc;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.info-label {
    font-weight: 500;
    color: #4a5568;
}

.info-value {
    font-weight: 600;
    color: #2d3748;
    font-family: 'Courier New', monospace;
    background: #edf2f7;
    padding: 3px 6px;
    border-radius: 3px;
}

.copy-btn {
    background: var(--corporate-green);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #6BC200;
    transform: translateY(-1px);
}

/* Mensaje de acceso denegado */
.error-container {
    text-align: center;
    padding: 50px 20px;
}

.error-message h2 {
    color: #e53e3e;
    margin-bottom: 12px;
}

.error-message p {
    color: #718096;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 6px;
    }
    
    .header {
        padding: 12px 10px;
        margin-bottom: 10px;
    }
    
    section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input[type="url"] {
        min-width: auto;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .info-grid {
        flex-direction: column;
        align-items: stretch;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2rem;
    }
    
    .upload-area {
        padding: 12px 8px;
    }
    
    .btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        min-width: 70px;
    }
    
    .link-display,
    .password-display,
    .combined-display {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Conversor de imágenes */
.image-converter-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.section-description {
    color: #718096;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.image-drop-area {
    border: 3px dashed #cbd5e0;
    border-radius: 8px;
    padding: 18px 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f7fafc;
}

.image-drop-area:hover,
.image-drop-area.dragover {
    border-color: var(--corporate-green);
    background: #edf2f7;
    transform: translateY(-1px);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.drop-icon {
    font-size: 1.8rem;
    color: var(--corporate-green);
}

.image-drop-area p {
    color: #4a5568;
    font-size: 0.85rem;
    margin: 0;
}

.formats-info {
    color: var(--corporate-green);
    font-size: 0.75rem;
    font-weight: 500;
}

.converter-options {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.8rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 0.8rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--corporate-green);
}

.quality-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-control input[type="range"] {
    flex: 1;
}

.quality-value {
    display: inline-block;
    font-weight: 500;
    color: var(--corporate-green);
    min-width: 35px;
    text-align: center;
    font-size: 0.8rem;
}

/* Archivos seleccionados */
.selected-files {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.selected-files h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #2d3748;
}

.files-list {
    max-height: 140px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    margin-bottom: 6px;
}

.file-icon {
    font-size: 1rem;
}

.file-name {
    flex: 1;
    font-size: 0.75rem;
    color: #2d3748;
    word-break: break-all;
}

.file-size {
    font-size: 0.7rem;
    color: #718096;
    white-space: nowrap;
}

.remove-file {
    background: #fed7d7;
    color: #742a2a;
    border: none;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #feb2b2;
}

/* Barra de progreso de conversión */
#imageProgressContainer .progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #718096;
}

#imageProgressContainer .progress-details span {
    flex: 1;
    text-align: center;
}

/* Resultado de conversión */
.conversion-result {
    margin-top: 14px;
}

.converted-files {
    margin-top: 10px;
}

.converted-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.converted-file-item .file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.converted-file-item .file-icon {
    font-size: 1.2rem;
}

.converted-file-item .file-name {
    font-weight: 500;
    color: #2d3748;
}

.converted-file-item .file-size {
    color: #718096;
    font-size: 0.8rem;
}

.converted-file-item .file-actions {
    display: flex;
    gap: 8px;
}

.download-all-section {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.download-all-section .btn {
    min-width: 200px;
}

/* Procesador CSV */
.csv-drop-area {
    border: 3px dashed #cbd5e0;
    border-radius: 8px;
    padding: 18px 12px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f7fafc;
}

.csv-drop-area:hover,
.csv-drop-area.dragover {
    border-color: var(--corporate-green);
    background: #edf2f7;
    transform: translateY(-1px);
}

.csv-drop-area .drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.csv-drop-area .drop-icon {
    font-size: 1.8rem;
    color: var(--corporate-green);
}

.csv-drop-area p {
    color: #4a5568;
    font-size: 0.85rem;
    margin: 0;
}

.csv-drop-area .formats-info {
    color: var(--corporate-green);
    font-size: 0.75rem;
    font-weight: 500;
}

.selected-csv-file {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
}

.selected-csv-file h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #2d3748;
}

.csv-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
}

.csv-file-info .file-icon {
    font-size: 1rem;
}

.csv-file-info .file-name {
    flex: 1;
    font-size: 0.75rem;
    color: #2d3748;
    word-break: break-all;
}

.csv-file-info .file-size {
    font-size: 0.7rem;
    color: #718096;
    white-space: nowrap;
}

.csv-file-info .remove-file {
    background: #fed7d7;
    color: #742a2a;
    border: none;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.csv-file-info .remove-file:hover {
    background: #feb2b2;
}

/* Botón de descarga CSV */
.download-section {
    margin-top: 15px;
    text-align: center;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--corporate-green), #6BC200);
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

