/* ============================================
   EJEMPLO: Cómo usar componentes desde CSS
   ============================================ */

/* 
   Este archivo demuestra cómo organizar estilos
   que trabajan con los componentes JavaScript
*/

/* ===== COMPONENTE MODAL REUTILIZABLE ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #1e293b;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    color: #cbd5e1;
}

/* ===== COMPONENTE TOAST NOTIFICATION ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #1e293b;
    color: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== COMPONENTE LOADING SPINNER ===== */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== COMPONENTE DROPDOWN MENU ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: #334155;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.dropdown-toggle:hover {
    background: #475569;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    display: none;
    z-index: 100;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    display: block;
    transition: background 0.3s;
}

.dropdown-item:hover {
    background: #334155;
    color: #fff;
}

/* ===== COMPONENTE TABS ===== */
.tabs-wrapper {
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.tab-button {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tabs-content {
    padding: 24px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ===== COMPONENTE ACCORDION ===== */
.accordion-item {
    background: #1e293b;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.accordion-header {
    background: #334155;
    padding: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    transition: background 0.3s;
}

.accordion-header:hover {
    background: #475569;
}

.accordion-icon {
    transition: transform 0.3s;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
    padding: 16px;
}

/* ===== COMPONENTE BADGE ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge.success {
    background: #10b981;
    color: #fff;
}

.badge.error {
    background: #ef4444;
    color: #fff;
}

.badge.warning {
    background: #f59e0b;
    color: #fff;
}

.badge.info {
    background: #3b82f6;
    color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 16px;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
    }
}
