@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
    min-height: 100vh;
}

/* Notificaciones */
.notificaciones-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.notificacion {
    background: white;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s ease-out;
    border-left: 4px solid;
    min-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notificacion.saliendo {
    animation: slideOutRight 0.4s ease-out forwards;
}

.notificacion.exito {
    border-left-color: #25D366;
    background: linear-gradient(135deg, #f0fdf4 0%, #f0fdf4 100%);
}

.notificacion.error {
    border-left-color: #ff6b6b;
    background: linear-gradient(135deg, #fef2f2 0%, #fef2f2 100%);
}

.notificacion.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #f0f9ff 0%, #f0f9ff 100%);
}

.notificacion-icono {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notificacion.exito .notificacion-icono {
    color: #25D366;
}

.notificacion.error .notificacion-icono {
    color: #ff6b6b;
}

.notificacion.info .notificacion-icono {
    color: #3b82f6;
}

.notificacion-contenido {
    flex: 1;
}

.notificacion-titulo {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.notificacion.exito .notificacion-titulo {
    color: #15803d;
}

.notificacion.error .notificacion-titulo {
    color: #991b1b;
}

.notificacion.info .notificacion-titulo {
    color: #1e40af;
}

.notificacion-mensaje {
    font-size: 0.85rem;
    opacity: 0.8;
}

.notificacion.exito .notificacion-mensaje {
    color: #166534;
}

.notificacion.error .notificacion-mensaje {
    color: #7f1d1d;
}

.notificacion.info .notificacion-mensaje {
    color: #1e3a8a;
}

.notificacion-cerrar {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.notificacion-cerrar:hover {
    opacity: 1;
}

/* Login Screen */
.login-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.login-screen::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(30px);
    }
}

.login-screen.active {
    display: flex;
}

.login-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
    padding: 3.5rem 2.5rem;
    animation: slideUp 0.6s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    display: block;
}

.login-header h1 {
    font-size: 2rem;
    color: #1a3a52;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #999;
    font-size: 0.95rem;
    font-weight: 500;
}

.login-form {
    margin-bottom: 2rem;
}

.login-form .form-group {
    margin-bottom: 1.8rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.7rem;
    font-weight: 600;
    color: #1a3a52;
    font-size: 0.9rem;
}

.input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 1.2rem;
    transition: all 0.3s;
    background: #f8f9fa;
}

.input-group:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.1);
}

.input-group i {
    color: #667eea;
    margin-right: 1rem;
    font-size: 1.1rem;
}

.input-group input {
    flex: 1;
    border: none;
    padding: 1rem 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    background: transparent;
}

.input-group input:focus {
    outline: none;
}

.input-group input::placeholder {
    color: #ccc;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.checkbox input {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.login-error {
    color: #ff4757;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #ffe0e0;
    border-radius: 8px;
    display: none;
}

.login-error.show {
    display: block;
}

.login-footer {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 2rem;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.login-footer p {
    margin: 0.5rem 0;
}

.login-footer strong {
    color: #1a3a52;
}

/* Admin Container */
.admin-container {
    display: none;
    min-height: 100vh;
    background: #f0f2f5;
}

.admin-container.active,
#adminPanel {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, #1a3a52 0%, #2c5aa0 100%);
    color: white;
    padding: 2rem 0;
    position: fixed;
    width: 250px;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0,0,0,0.15);
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.8rem;
}

.nav-item {
    padding: 1rem 1.2rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    padding-left: 1.4rem;
}

.nav-item.active {
    background: rgba(255,211,0,0.15);
    color: #FFD700;
    border-left-color: #FFD700;
    padding-left: 1.4rem;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Grupos de Navegación */
.nav-group {
    margin-bottom: 1.5rem;
}

.nav-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    padding: 0.8rem 1.2rem 0.5rem;
    letter-spacing: 1px;
}

.nav-group:first-child .nav-group-title {
    margin-top: 0;
}

/* Main Content */
.admin-main {
    margin-left: 250px;
    padding: 2.5rem;
    background: #f0f2f5;
    flex: 1;
    width: calc(100% - 250px);
    overflow-y: auto;
}

.admin-header {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-header h1 {
    font-size: 1.8rem;
    color: #1a3a52;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#userInfo {
    color: #666;
    font-weight: 500;
}

.btn-toggle-sidebar {
    display: none;
    background: none;
    border: none;
    color: #1a3a52;
    font-size: 1.5rem;
    cursor: pointer;
}

.btn-logout {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-logout:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Admin Sections */
.admin-section {
    display: none;
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f2f5;
}

.section-header h2 {
    font-size: 1.6rem;
    color: #1a3a52;
    font-weight: 700;
}

/* Forms */
.config-form,
.modal-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.7rem;
    font-weight: 600;
    color: #1a3a52;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

/* Security Section */
.security-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f2f5;
}

.security-section h3 {
    font-size: 1.2rem;
    color: #1a3a52;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-main {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        transition: left 0.3s;
        z-index: 999;
    }

    .sidebar.active {
        left: 0;
    }

    .btn-toggle-sidebar {
        display: block;
    }

    .admin-header {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .admin-header h1 {
        font-size: 1.4rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .config-form,
    .modal-form {
        grid-template-columns: 1fr;
    }

    .admin-section {
        padding: 1.5rem;
    }
}


/* Modales */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 2px solid #f0f2f5;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: #1a3a52;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #ff6b6b;
    transform: rotate(90deg);
}

.modal-form {
    padding: 2rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.form-actions button {
    flex: 1;
}

/* Listas de Productos y Categorías */
.productos-list,
.categorias-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.producto-item,
.categoria-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border-top: 4px solid #667eea;
}

.producto-item:hover,
.categoria-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.producto-img,
.categoria-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f5f5f5;
}

.producto-info,
.categoria-info {
    padding: 1.5rem;
}

.producto-info h3,
.categoria-info h3 {
    font-size: 1.2rem;
    color: #1a3a52;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.producto-info p,
.categoria-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.producto-meta,
.categoria-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.producto-meta span,
.categoria-header span {
    font-size: 0.85rem;
    color: #999;
}

.categoria-emoji {
    font-size: 1.8rem;
}

.producto-actions,
.categoria-actions {
    display: flex;
    gap: 0.8rem;
}

.btn-edit,
.btn-danger {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
}

.btn-edit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-danger:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

@media (max-width: 768px) {
    .productos-list,
    .categorias-list {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-form {
        padding: 1.5rem;
    }
}


/* Estilos para Color Inputs */
input[type="color"] {
    width: 80px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 2px;
}

input[type="color"]:hover {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

input[type="color"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

/* Botones de Preset */
.btn-preset {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-preset:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-preset:active {
    transform: translateY(-1px);
}

/* ===== NUEVA SECCIÓN DE COLORES MEJORADA ===== */

/* Presets Section */
.presets-section {
    margin-bottom: 2rem;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.preset-btn {
    position: relative;
    width: 100%;
    height: 120px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.preset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.preset-btn:hover::before {
    opacity: 1;
}

.preset-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.preset-btn:active {
    transform: translateY(-4px) scale(1.02);
}

.preset-name {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Presets de colores específicos */
.preset-purpura {
    background: linear-gradient(135deg, #1a1f3a 0%, #2d1b4e 50%, #A78BFA 100%);
}

.preset-verde {
    background: linear-gradient(135deg, #1a3a2a 0%, #2d4a3a 50%, #4ade80 100%);
}

.preset-azul {
    background: linear-gradient(135deg, #1a2a3a 0%, #2d3a5a 50%, #3b82f6 100%);
}

.preset-coral {
    background: linear-gradient(135deg, #3a1a1a 0%, #5a2d2d 50%, #ff6b6b 100%);
}

.preset-cielo {
    background: linear-gradient(135deg, #0a3a5a 0%, #1a5a8f 50%, #2FA8F4 100%);
}

.preset-magenta {
    background: linear-gradient(135deg, #f702ef 0%, #d946ef 50%, #ec4899 100%);
}

/* Custom Colors Section */
.custom-colors-section {
    margin-bottom: 2rem;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.color-picker-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.color-picker-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.color-picker-header {
    margin-bottom: 1.5rem;
}

.color-picker-header h4 {
    font-size: 1.1rem;
    color: #1a3a52;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.color-description {
    font-size: 0.85rem;
    color: #999;
    margin: 0;
}

.color-picker-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.2rem;
}

.color-input {
    width: 100px;
    height: 80px;
    border: 3px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px;
    background: white;
    flex-shrink: 0;
}

.color-input:hover {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.color-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.4);
}

.color-preview {
    flex: 1;
    height: 80px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.hex-input {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a3a52;
    background: white;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.hex-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

/* Preview Section */
.preview-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.preview-box {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.preview-header {
    padding: 2rem;
    background: linear-gradient(135deg, #1a1f3a 0%, #2d1b4e 50%, #A78BFA 100%);
    color: white;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.preview-content {
    padding: 2rem;
    text-align: center;
}

.preview-btn {
    background: linear-gradient(135deg, #A78BFA 0%, #E9D5FF 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.3);
}

.preview-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(167, 139, 250, 0.4);
}

/* Sincronización de color picker y hex input */
.color-input,
.hex-input {
    transition: all 0.2s ease;
}

/* Responsive */
@media (max-width: 1024px) {
    .colors-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .colors-grid {
        grid-template-columns: 1fr;
    }

    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .preset-btn {
        height: 100px;
        font-size: 0.85rem;
    }

    .color-picker-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .color-input {
        width: 100%;
        height: 70px;
    }

    .color-preview {
        width: 100%;
        height: 70px;
    }

    .preview-section {
        padding: 1.5rem;
    }

    .preview-header {
        padding: 1.5rem;
        font-size: 1rem;
    }

    .preview-content {
        padding: 1.5rem;
    }
}


/* Loading Animation para Presets */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.preset-btn.loading {
    animation: pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

.preset-btn.loading .preset-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-btn.loading .preset-name::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #2FA8F4;
    border-right-color: #2FA8F4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 10px rgba(47, 168, 244, 0.8), inset 0 0 10px rgba(47, 168, 244, 0.4);
}
