/* --- General Body & Typography --- */
body { 
    font-family: 'Inter', sans-serif; 
}

/* --- Background for Auth Screen --- */
body.auth-bg {
    position: relative; /* Necesario para el pseudo-elemento */
    background-image: url('assets/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 0; /* Asegura un contexto de apilamiento */
}

/* Pseudo-elemento para la capa de color animada y translúcida */
body.auth-bg::before {
    content: '';
    position: fixed; /* Cubre toda la pantalla */
    inset: 0;
    z-index: -1; /* Se coloca detrás del contenido, pero sobre el fondo del body */

    /* El gradiente animado */
    background: linear-gradient(-45deg, #4b0082, #8a2be2, #4169e1, #00ced1, #23d5ab);
    background-size: 400% 400%;
    animation: gradient-animation 18s ease infinite;

    /* --- ¡AQUÍ ESTÁ LA MAGIA! --- */
    opacity: 0.4; /* Ajusta este valor (entre 0.0 y 1.0) para la transparencia deseada */
}

/* --- Glassmorphism Effect for Auth Form --- */
.form-container { 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Page Section Transitions --- */
@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-section:not(.hidden) {
    animation: fadeIn 0.4s ease-out;
}

/* --- Custom Styled Select Dropdowns --- */
select.custom-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; /* Make space for the arrow */
    /* Replicating Tailwind classes */
    width: 100%;
    background-color: #F9FAFB; /* bg-gray-50 */
    border: 1px solid #D1D5DB; /* border-gray-300 */
    color: #111827; /* text-gray-900 */
    font-size: 0.875rem; /* text-sm */
    border-radius: 0.5rem; /* rounded-lg */
    padding: 0.625rem; /* p-2.5 */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
select.custom-select:focus {
    outline: none;
    border-color: #8b5cf6; /* focus:border-violet-500 */
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3); /* focus:ring-violet-500 */
}

/* --- Improved Button Styles --- */
.btn-primary {
    background-color: #7c3aed; /* bg-violet-600 */
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.btn-primary:hover {
    background-color: #6d28d9; /* hover:bg-violet-700 */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

.btn-secondary {
    background-image: linear-gradient(to right, #00c4cc, #7d2ae8);
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.btn-secondary:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

.btn-gemini {
    background-color: #f3f4f6; /* gray-100 */
    color: #374151; /* gray-700 */
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb; /* gray-200 */
}
.btn-gemini:hover {
    background-color: #e5e7eb; /* gray-200 */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

.btn-dashboard-action {
    background-color: #f3f4f6; /* gray-100 */
    color: #374151; /* gray-700 */
    border: 1px solid #e5e7eb; /* gray-200 */
    font-weight: 600;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: all 0.2s ease-in-out;
}
.btn-dashboard-action:hover {
    background-color: #e5e7eb; /* gray-200 */
    color: #1f2937; /* gray-800 */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

.recent-upload-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 0.75rem; /* rounded-xl */
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recent-upload-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

/* --- Status Indicator --- */
.status-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
}

.status-dot-online {
    background-color: #22c55e; /* green-500 */
    /* A subtle glow effect */
    box-shadow: 0 0 6px #22c55e;
}

.status-dot-offline {
    background-color: #ef4444; /* red-500 */
}

/* --- Drag and Drop Styles --- */
.dragging { 
    opacity: 0.4; 
    border: 2px dashed #8b5cf6;
    transform: scale(0.95);
}
.drag-over { 
    background-color: rgba(139, 92, 246, 0.05); 
    border: 2px dashed rgba(139, 92, 246, 0.4);
}

/* --- Modal Transitions --- */
.modal { 
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}
.modal.active { 
    display: flex; 
    opacity: 1;
}

/* Estilos para los nuevos inputs con iconos (CORREGIDO) */
.form-input-icon {
    display: block;
    width: 100%;
    padding-left: 2.5rem; /* 40px para dejar espacio al icono */
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border: 1px solid #D1D5DB; /* border-gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
}

.form-input-icon:focus {
    outline: none;
    border-color: #7c3aed; /* focus:border-violet-600 */
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2); /* Un anillo de foco sutil */
}
.modal > div { /* Animate the inner content */
    transition: transform 0.3s ease;
    transform: scale(0.95);
}
.modal.active > div {
    transform: scale(1);
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px; /* w-11 */
    height: 24px; /* h-6 */
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db; /* bg-gray-300 */
    transition: .4s;
    border-radius: 24px; /* rounded-full */
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px; /* h-4 */
    width: 16px; /* w-4 */
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%; /* rounded-full */
}

input:checked + .toggle-slider {
    background-color: #6366f1; /* bg-indigo-500 */
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px #6366f1;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* --- Language Selector Polish --- */
.lang-selector img {
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease-in-out;
    border-radius: 50%;
    box-shadow: 0 0 0 0px rgba(139, 92, 246, 0.5);
}
.lang-selector img:hover {
    opacity: 1;
    transform: scale(1.1);
}
.lang-selector img.active {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5);
}

/* --- Card Styles (Normal & Glass) --- */
.card {
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); /* shadow-xl */
    transform: translateY(-0.25rem); /* -translate-y-1 */
}
.card-glass {
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Hide Number Input Arrows --- */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] { 
    -moz-appearance: textfield; 
    appearance: textfield;
}

/* Estilos para la selección de medios en el modal de QR */
.qr-media-card-selectable {
    position: relative;
    cursor: pointer;
    border: 4px solid transparent;
    border-radius: 0.5rem; /* rounded-lg */
    overflow: hidden;
}

.qr-media-card-selectable.selected {
    border-color: #7c3aed; /* violet-600 */
}

.qr-media-card-selectable.selected::after {
    content: '✓';
    position: absolute;
    top: 0.5rem; /* top-2 */
    right: 0.5rem; /* right-2 */
    background-color: #7c3aed; /* bg-violet-600 */
    color: white;
    border-radius: 9999px; /* rounded-full */
    width: 1.5rem; /* w-6 */
    height: 1.5rem; /* h-6 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700; /* font-bold */
}

/* --- List Button Items (Playlists, Groups) --- */
.list-button-item {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: rgba(255, 255, 255, 0.8);
    color: #374151;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    position: relative;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-button-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    background-color: white;
    z-index: 1;
}

.list-button-item.active {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.5), 0 2px 4px -1px rgba(124, 58, 237, 0.3);
    border-color: transparent;
}

.list-button-item.active:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.6), 0 4px 6px -2px rgba(124, 58, 237, 0.4);
}

.list-button-item::after {
    content: '→';
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    font-size: 1.2em;
}

.list-button-item:hover::after,
.list-button-item.active::after {
    opacity: 1;
    transform: translateX(0);
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}
