/* Estilos personalizados para WISP Manager */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

footer {
    margin-top: auto;
}

/* Navbar personalizado */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

/* Cards */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Jumbotron personalizado */
.jumbotron {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.jumbotron.bg-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    color: #333;
}

/* Tablas */
.table {
    background: white;
}

.table thead {
    background-color: #f8f9fa;
}

/* Botones */
.btn {
    border-radius: 5px;
    padding: 8px 20px;
    transition: all 0.3s;
}

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

/* Formularios */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

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

/* Página de error */
.error-page {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Responsividad */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .jumbotron h1 {
        font-size: 2rem;
    }

    .card {
        margin-bottom: 15px;
    }
}

/* Utilidades */
.cursor-pointer {
    cursor: pointer;
}

.text-small {
    font-size: 0.875rem;
}

.badge-custom {
    padding: 5px 10px;
    border-radius: 12px;
}

/* ========================================
   SIDEBAR LAYOUT
   ======================================== */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

#sidebar-wrapper {
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    transition: margin 0.3s ease-in-out;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

#sidebar-wrapper.toggled {
    margin-left: -260px;
}

/* Scrollbar personalizado para el sidebar */
#sidebar-wrapper::-webkit-scrollbar {
    width: 8px;
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

#page-content-wrapper {
    width: 100%;
    margin-left: 260px;
    transition: margin 0.3s ease-in-out;
}

#page-content-wrapper.toggled {
    margin-left: 0;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-menu li a {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 25px;
    color: #fff;
}

.sidebar-menu li a.active {
    background: rgba(52, 152, 219, 0.3);
    border-left: 4px solid #3498db;
    color: #fff;
}

.sidebar-menu li a i {
    width: 25px;
    margin-right: 10px;
    text-align: center;
    font-size: 1.1rem;
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    display: none;
}

.sidebar-submenu.show {
    display: block;
}

.sidebar-submenu li a {
    padding: 12px 20px 12px 55px;
    font-size: 0.9rem;
    color: #bdc3c7;
}

.sidebar-submenu li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Dropdown toggle */
.dropdown-toggle-sidebar::after {
    content: "\f078";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    float: right;
    transition: transform 0.3s;
}

.dropdown-toggle-sidebar.active::after {
    transform: rotate(180deg);
}

/* Top Navbar */
.top-navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2c3e50;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: #f8f9fa;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu .dropdown {
    position: relative;
}

.user-menu .dropdown-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: background 0.3s;
}

.user-menu .dropdown-toggle:hover {
    background: #f8f9fa;
}

.user-menu .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
}

.user-menu .dropdown-menu.show {
    display: block;
}

.user-menu .dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #2c3e50;
    text-decoration: none;
    transition: background 0.3s;
}

.user-menu .dropdown-menu a:hover {
    background: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: -260px;
    }

    #sidebar-wrapper.toggled {
        margin-left: 0;
    }

    #page-content-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper.toggled {
        margin-left: 0;
    }
}

/* Main Content */
.main-content {
    padding: 30px;
    background: #f8f9fa;
    min-height: calc(100vh - 70px);
}

/* ========================================
   TOAST NOTIFICATION SYSTEM
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;       /* posición por defecto; JS la cambia a bottom cuando el usuario scrollea */
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    transition: top 0.25s ease, bottom 0.25s ease;
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease-in-out;
    min-width: 300px;
    border-left: 4px solid;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.hide {
    opacity: 0;
    transform: translateX(400px);
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* Toast Types */
.toast-notification.toast-success {
    border-left-color: #198754;
}

.toast-notification.toast-success .toast-icon {
    color: #198754;
}

.toast-notification.toast-error {
    border-left-color: #dc3545;
}

.toast-notification.toast-error .toast-icon {
    color: #dc3545;
}

.toast-notification.toast-warning {
    border-left-color: #ffc107;
}

.toast-notification.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-notification.toast-info {
    border-left-color: #0dcaf0;
}

.toast-notification.toast-info .toast-icon {
    color: #0dcaf0;
}

/* Responsive Toast */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast-notification {
        min-width: auto;
        width: 100%;
    }
}