/* ============================================================
   TEBASLIVE — Enhanced Liquid Glass Design
   Premium glassmorphism with animations & micro-interactions
   ============================================================ */

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRow {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmerBorder {
    0% {
        border-color: rgba(255, 255, 255, 0.15);
    }

    50% {
        border-color: rgba(255, 255, 255, 0.3);
    }

    100% {
        border-color: rgba(255, 255, 255, 0.15);
    }
}

@keyframes pulseHeart {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes subtleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* === TYPOGRAPHY === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.2px;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
}

/* Overlay is defined in layout.html inline styles */

/* === NAVBAR ENHANCEMENTS === */
.navbar {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(20px) saturate(1.4) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    transition: background 0.3s ease;
}

.navbar-brand {
    font-size: 1.05rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

/* Enhanced nav buttons */
.navbar .btn {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 8px;
    padding: 6px 16px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.navbar .btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: inherit;
}

.navbar .btn:hover::after {
    opacity: 1;
}

.navbar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.navbar .btn:active {
    transform: translateY(0);
}

/* === ENHANCED GLASS CARD === */
.glass-card {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(16px) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease-out;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Title decoration */
.glass-card h3,
.glass-card h4 {
    position: relative;
    padding-bottom: 12px;
}

.glass-card h3::after,
.glass-card h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.0));
    border-radius: 2px;
}

/* === ENHANCED FORM CONTROLS === */
.glass-card .form-control {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: white;
    padding: 10px 14px;
    font-size: 0.92rem;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}

.glass-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.glass-card .form-control:focus {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 0 20px rgba(255, 255, 255, 0.05);
    color: white;
}

.glass-card .form-control:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Better labels */
.glass-card .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

/* Switch styling */
.glass-card .form-check-input {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    cursor: pointer;
}

.glass-card .form-check-input:checked {
    background-color: rgba(100, 200, 255, 0.7);
    border-color: rgba(100, 200, 255, 0.8);
}

.glass-card .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(100, 200, 255, 0.15);
}

.glass-card .form-check-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
}

/* === ENHANCED BUTTONS (inside cards) === */
.glass-card .btn-primary {
    background: rgba(80, 160, 255, 0.6);
    border: 1px solid rgba(80, 160, 255, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 10px 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card .btn-primary:hover {
    background: rgba(80, 160, 255, 0.75);
    border-color: rgba(80, 160, 255, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(80, 160, 255, 0.25);
}

.glass-card .btn-success {
    background: rgba(60, 200, 120, 0.6);
    border: 1px solid rgba(60, 200, 120, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card .btn-success:hover {
    background: rgba(60, 200, 120, 0.75);
    border-color: rgba(60, 200, 120, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(60, 200, 120, 0.25);
}

/* === ENHANCED GLASS TABLE === */
.glass-table {
    border-spacing: 0 6px !important;
}

.glass-table thead th {
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(12px) !important;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.85);
    padding: 14px 12px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.glass-table tbody tr {
    background: rgba(255, 255, 255, 0.04) !important;
    transition: background-color 0.25s ease !important;
    animation: slideInRow 0.35s ease-out backwards;
}

/* Staggered row animations */
.glass-table tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

.glass-table tbody tr:nth-child(2) {
    animation-delay: 0.1s;
}

.glass-table tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

.glass-table tbody tr:nth-child(4) {
    animation-delay: 0.2s;
}

.glass-table tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

.glass-table tbody tr:nth-child(6) {
    animation-delay: 0.3s;
}

.glass-table tbody tr:nth-child(7) {
    animation-delay: 0.35s;
}

.glass-table tbody tr:nth-child(8) {
    animation-delay: 0.4s;
}

.glass-table tbody tr:nth-child(9) {
    animation-delay: 0.45s;
}

.glass-table tbody tr:nth-child(10) {
    animation-delay: 0.5s;
}

.glass-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Table action buttons */
.glass-table .btn-sm {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 6px;
    padding: 4px 10px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.glass-table .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* === ENHANCED ALERTS === */
.alert {
    border-radius: 10px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.88rem;
    font-weight: 500;
    animation: fadeInUp 0.35s ease-out;
}

.alert-success {
    background: rgba(60, 200, 120, 0.15);
    border-color: rgba(60, 200, 120, 0.3);
    color: #8fffb3;
}

.alert-danger {
    background: rgba(255, 80, 80, 0.15);
    border-color: rgba(255, 80, 80, 0.3);
    color: #ffaaaa;
}

.alert-warning {
    background: rgba(255, 200, 60, 0.15);
    border-color: rgba(255, 200, 60, 0.3);
    color: #ffe08a;
}

.alert-info {
    background: rgba(80, 180, 255, 0.15);
    border-color: rgba(80, 180, 255, 0.3);
    color: #a0d8ff;
}

/* === ENHANCED FOOTER === */
footer {
    background: rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(16px) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.3) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    font-size: 0.82rem;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.6);
}

footer .heart {
    display: inline-block;
    animation: pulseHeart 1.5s ease-in-out infinite;
}

/* === ENHANCED MODALS === */
.modal-content.glass-card {
    animation: fadeInScale 0.3s ease-out;
}

.modal-content.glass-card .modal-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
}

.modal-content.glass-card .modal-body {
    color: rgba(255, 255, 255, 0.85);
}

.modal-content.glass-card .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-content.glass-card .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}

.modal-content.glass-card .btn-primary,
.modal-content.glass-card .btn-warning,
.modal-content.glass-card .btn-danger,
.modal-content.glass-card .btn-info {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-content.glass-card .btn-primary:hover,
.modal-content.glass-card .btn-warning:hover,
.modal-content.glass-card .btn-danger:hover,
.modal-content.glass-card .btn-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Modal form controls */
.modal-content.glass-card .form-control {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    transition: all 0.2s ease;
}

.modal-content.glass-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.modal-content.glass-card .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
    color: white;
}

.modal-content.glass-card .form-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.modal-content.glass-card .form-check-input {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.modal-content.glass-card .form-check-input:checked {
    background-color: rgba(100, 200, 255, 0.7);
    border-color: rgba(100, 200, 255, 0.8);
}

.modal-content.glass-card .form-check-label {
    color: rgba(255, 255, 255, 0.7);
}

/* For the non-glass restart modal (text-dark) */
.modal-content.text-dark {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* === IP DISPLAY (Dashboard) === */
#ip-info {
    font-weight: 600;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.3px;
}

/* Main area btn-success */
#updateBtn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 10px 28px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#updateBtn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(60, 200, 120, 0.3);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* === SELECTION === */
::selection {
    background: rgba(100, 180, 255, 0.3);
    color: white;
}

/* === RESPONSIVE ENHANCEMENTS === */
@media (max-width: 576px) {
    .glass-card {
        border-radius: 12px !important;
        padding: 18px !important;
    }

    .glass-table {
        font-size: 0.82rem;
    }

    .glass-table thead th {
        font-size: 0.68rem;
        padding: 10px 8px !important;
    }

    .glass-table td {
        padding: 10px 8px;
    }
}

/* === USER AVATAR DROPDOWN === */
.user-dropdown-wrapper {
    position: relative;
}

.user-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-size: 0.88rem;
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(120, 90, 220, 0.9), rgba(80, 160, 255, 0.9));
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.avatar-name {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.9);
}

.avatar-chevron {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.25s ease;
}

.user-avatar-btn[aria-expanded="true"] .avatar-chevron {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: rgba(18, 18, 28, 0.85);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    padding: 6px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Dropdown Header */
.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.dropdown-avatar-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(120, 90, 220, 0.9), rgba(80, 160, 255, 0.9));
    font-weight: 700;
    font-size: 1rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.dropdown-display-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.2;
}

.dropdown-username {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
}

/* Divider */
.user-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2px 10px;
}

/* Dropdown Items */
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 2px 0;
}

.user-dropdown-item i {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    width: 20px;
    text-align: center;
    transition: color 0.2s ease;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.user-dropdown-item:hover i {
    color: rgba(255, 255, 255, 0.8);
}

/* Danger variant (Cerrar sesión) */
.user-dropdown-item--danger:hover {
    background: rgba(255, 80, 80, 0.15);
    color: #ffaaaa;
}

.user-dropdown-item--danger:hover i {
    color: #ff8888;
}