/* ============================================
   QR GENERATOR FREE - ESTILOS PRINCIPALES
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #1a202c;
    line-height: 1.6;
    min-height: 100vh;
}

/* === HEADER === */
.qr-generator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 1rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* === MAIN LAYOUT === */
.qr-generator-wrapper {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    padding-bottom: 5rem;
}

.qr-editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* === EDITOR PANEL === */
.qr-editor-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    overflow-y: auto;
    min-height: 100vh;
}

.qr-editor-panel::-webkit-scrollbar {
    width: 8px;
}

.qr-editor-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.qr-editor-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.qr-editor-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* === TYPE SELECTOR === */
.qr-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border: 2px solid #cbd5e1;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a202c;
}

.type-btn:hover {
    border-color: #667eea;
    background: #9454D9;
    transform: translateY(-2px);
}

.type-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.type-btn .icon {
    font-size: 1.5rem;
}

.type-btn .label {
    font-size: 0.75rem;
}

/* === ECC BUTTONS === */
/* === FINDER SHAPES GRID === */
.finder-shapes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.75rem;
}



/* === FORM INPUTS === */
.form-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 60px;
    width: 100%;
}

.form-inputs label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
    width: 100%;
}

.form-inputs input[type="text"],
.form-inputs input[type="email"],
.form-inputs input[type="tel"],
.form-inputs input[type="password"],
.form-inputs input[type="url"],
.form-inputs textarea,
.form-inputs select {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #f9fafb;
    transition: all 0.3s ease;
    width: 100%;
}

.form-inputs input:focus,
.form-inputs textarea:focus,
.form-inputs select:focus {
    outline: none;
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-inputs textarea {
    resize: vertical;
    min-height: 80px;
}

/* === FORM SECTIONS === */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* === FORM INPUTS === */
.form-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-inputs label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-inputs input[type="text"],
.form-inputs input[type="email"],
.form-inputs input[type="tel"],
.form-inputs input[type="password"],
.form-inputs textarea,
.form-inputs select {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.form-inputs input:focus,
.form-inputs textarea:focus,
.form-inputs select:focus {
    outline: none;
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-inputs textarea {
    resize: vertical;
    min-height: 80px;
}

/* === APPEARANCE GRID === */
.appearance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.control-group select {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* === RANGE CONTROL === */
.range-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.range-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.2s;
}

.range-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.2s;
}

.range-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.2);
}

.range-control span {
    min-width: 50px;
    text-align: right;
    font-weight: 700;
    color: #667eea;
    font-size: 0.9rem;
}

/* === COLOR CONTROL === */
.color-control {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.color-control input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.color-control input[type="color"]:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.color-hex {
    flex: 1;
    padding: 0.5rem 0.75rem !important;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
}

/* === FILE INPUT === */
.file-input {
    padding: 0.75rem;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.control-group small {
    font-size: 0.8rem;
    color: #718096;
}

/* === BUTTONS === */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn-secondary {
    background: #4a5568;
    color: white;
}

.btn-secondary:hover {
    background: #2d3748;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-info {
    background: #4299e1;
    color: white;
}

.btn-info:hover {
    background: #3182ce;
}

.btn-block {
    width: 100%;
}

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

/* === PREVIEW PANEL === */
.qr-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
}

.preview-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.preview-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.qr-preview-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 1rem;
}

.qr-preview-canvas svg,
.qr-preview-canvas img,
.qr-preview-canvas canvas {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.preview-message {
    color: #718096;
    font-size: 0.95rem;
    font-weight: 500;
}

/* === DOWNLOAD SECTION === */
.qr-download-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.download-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.download-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.qr-download-section .btn {
    margin-bottom: 0.75rem;
}

.qr-download-section .btn:last-child {
    margin-bottom: 0;
}

/* === HISTORY SECTION === */
.qr-history-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.qr-history-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1.5rem;
}

.qr-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

.qr-history-item {
    position: relative;
    background: #f9fafb;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.qr-history-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.qr-history-item img,
.qr-history-item svg {
    width: 100%;
    height: auto;
    display: block;
}

.qr-history-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-weight: bold;
}

.qr-history-item:hover .qr-history-remove {
    opacity: 1;
}

/* === DARK MODE TOGGLE === */
.dark-mode-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e2e8f0;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .qr-editor-layout {
        grid-template-columns: 1fr;
    }

    .qr-editor-panel {
        max-height: none;
    }

    .header-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .qr-generator-header {
        padding: 2rem 1rem;
    }

    .header-content h1 {
        font-size: 1.75rem;
    }

    .header-content p {
        font-size: 0.95rem;
    }

    .qr-editor-panel {
        padding: 1.5rem;
    }

    .qr-type-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .type-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }

    .appearance-grid {
        grid-template-columns: 1fr;
    }

    .preview-container {
        min-height: 300px;
        padding: 1rem;
    }

    .dark-mode-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

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

.form-section {
    animation: slideIn 0.3s ease;
}
