/* ============================================
   PAINEL DNS - UNIÃO PLAY
   Estilos Customizados
   ============================================ */

:root {
    --up-blue-dark: #0d1b4a;
    --up-blue: #1a3a7a;
    --up-blue-light: #2952a3;
    --up-red: #dc3545;
    --up-red-dark: #a71d2a;
    --up-bg: #0a0e1a;
    --up-bg-card: #111827;
    --up-bg-card-hover: #1a2332;
    --up-text: #e2e8f0;
    --up-text-muted: #94a3b8;
    --up-border: #1e293b;
    --up-gradient: linear-gradient(135deg, #1a3a7a 0%, #dc3545 100%);
    --up-gradient-subtle: linear-gradient(135deg, rgba(26,58,122,0.3) 0%, rgba(220,53,69,0.3) 100%);
    --up-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --up-shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
    --up-glow-blue: 0 0 20px rgba(26, 58, 122, 0.4);
    --up-glow-red: 0 0 20px rgba(220, 53, 69, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--up-bg);
    color: var(--up-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--up-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--up-blue);
    border-radius: 4px;
}

/* ============ NAVBAR ============ */
.navbar {
    background: linear-gradient(135deg, #060e24 0%, #0d1b4a 50%, #1a0a1e 100%) !important;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, #1a5cd6, #e63946) 1;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(26, 92, 214, 0.3);
    padding: 0.5rem 1rem;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff !important;
    letter-spacing: 0.5px;
}

.navbar-brand .navbar-logo {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 2px 12px rgba(26, 92, 214, 0.6)) drop-shadow(0 2px 12px rgba(230, 57, 70, 0.3));
    transition: all 0.3s ease;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 20px rgba(26, 92, 214, 0.8)) drop-shadow(0 4px 20px rgba(230, 57, 70, 0.5));
}

.navbar .nav-link {
    color: var(--up-text-muted) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
}

.navbar .nav-link.active {
    background: var(--up-gradient-subtle);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .nav-link i {
    font-size: 1rem;
}

.navbar .btn-logout {
    color: var(--up-red) !important;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.navbar .btn-logout:hover {
    background: rgba(220, 53, 69, 0.15) !important;
    color: #ff6b7a !important;
}

/* ============ CONTEÚDO PRINCIPAL ============ */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-weight: 700;
    font-size: 1.6rem;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h2 i {
    background: linear-gradient(135deg, #4a8eff 0%, #e63946 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
}

/* ============ CARDS ============ */
.card {
    background: var(--up-bg-card);
    border: 1px solid var(--up-border);
    border-radius: 16px;
    box-shadow: var(--up-shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(26, 58, 122, 0.3);
    box-shadow: var(--up-shadow);
}

.card-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid var(--up-border) !important;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #fff;
    border-radius: 16px 16px 0 0 !important;
}

.card-body {
    padding: 1.5rem;
}

/* ============ TABELAS ============ */
.table {
    color: var(--up-text);
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, rgba(26, 92, 214, 0.2), rgba(230, 57, 70, 0.08));
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, #1a5cd6, #e63946) 1;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--up-border);
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(26, 92, 214, 0.08), rgba(230, 57, 70, 0.04));
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============ BADGES ============ */
.badge-active {
    background: linear-gradient(135deg, #1a5cd6, #4a8eff);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(26, 92, 214, 0.4);
}

.badge-inactive {
    background: linear-gradient(135deg, #b91c1c, #e63946);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.4);
}

.badge-active::before,
.badge-inactive::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ============ BOTÕES ============ */
.btn {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.5rem 1.2rem;
    font-size: 0.88rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1a5cd6 0%, #e63946 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(26, 92, 214, 0.4), 0 4px 15px rgba(230, 57, 70, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2d6ce0 0%, #ef4444 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(26, 92, 214, 0.5), 0 6px 25px rgba(230, 57, 70, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #1a5cd6, #4a8eff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(26, 92, 214, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #1550bb, #1a5cd6);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c, #e63946);
    color: #fff;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #991b1b, #b91c1c);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #b45309, #d97706);
    transform: translateY(-2px);
    color: #fff;
}

.btn-outline-light {
    border: 1px solid var(--up-border);
    color: var(--up-text-muted);
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    border-radius: 8px;
}

/* ============ FORMULÁRIOS ============ */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--up-border);
    color: var(--up-text);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--up-blue);
    box-shadow: var(--up-glow-blue);
    color: #fff;
}

.form-control::placeholder {
    color: var(--up-text-muted);
    opacity: 0.6;
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--up-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--up-border);
}

.form-check-input:checked {
    background-color: var(--up-blue);
    border-color: var(--up-blue);
}

.form-text {
    color: var(--up-text-muted);
    font-size: 0.8rem;
}

/* ============ ALERTAS ============ */
.alert {
    border-radius: 12px;
    border: none;
    font-weight: 500;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ============ LOGIN ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--up-bg);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 25% 40%, rgba(26, 92, 214, 0.25) 0%, transparent 50%),
                radial-gradient(ellipse at 75% 60%, rgba(230, 57, 70, 0.2) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(26, 92, 214, 0.08) 0%, transparent 70%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

.login-card {
    background: var(--up-bg-card);
    border: 1px solid var(--up-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--up-shadow);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1a5cd6 0%, #4a8eff 30%, #e63946 70%, #ff6b6b 100%);
    border-radius: 24px 24px 0 0;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 4px 25px rgba(26, 92, 214, 0.5)) drop-shadow(0 4px 25px rgba(230, 57, 70, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.3rem;
}

.login-subtitle {
    text-align: center;
    color: var(--up-text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-card .form-control {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem 1rem 0.8rem 2.8rem;
}

.login-card .input-group {
    position: relative;
}

.login-card .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--up-text-muted);
    z-index: 5;
    font-size: 1rem;
}

.login-card .btn-login {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

/* ============ STATS CARDS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--up-bg-card);
    border: 1px solid var(--up-border);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--up-shadow);
    border-color: rgba(26, 58, 122, 0.3);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.blue::before {
    background: linear-gradient(90deg, #1a5cd6, #4a8eff);
}

.stat-card.green::before {
    background: linear-gradient(90deg, #1a5cd6, #60a5fa);
}

.stat-card.red::before {
    background: linear-gradient(90deg, #b91c1c, #e63946);
}

.stat-card.orange::before {
    background: linear-gradient(90deg, #e63946, #ff6b6b);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.stat-card.blue .stat-icon {
    background: rgba(26, 92, 214, 0.2);
    color: #4a8eff;
}

.stat-card.green .stat-icon {
    background: rgba(26, 92, 214, 0.15);
    color: #60a5fa;
}

.stat-card.red .stat-icon {
    background: rgba(230, 57, 70, 0.2);
    color: #ff6b6b;
}

.stat-card.orange .stat-icon {
    background: rgba(230, 57, 70, 0.15);
    color: #e63946;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-card .stat-label {
    color: var(--up-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--up-text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    display: block;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* ============ DNS URL DISPLAY ============ */
.dns-url {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(26, 92, 214, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #4a8eff;
    border: 1px solid rgba(26, 92, 214, 0.25);
}

.dns-port {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(230, 57, 70, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #ff6b6b;
    border: 1px solid rgba(230, 57, 70, 0.25);
}

/* ============ ACTION BUTTONS ============ */
.action-buttons {
    display: flex;
    gap: 6px;
}

.action-buttons .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
}

/* ============ MODAL ============ */
.modal-content {
    background: var(--up-bg-card);
    border: 1px solid var(--up-border);
    border-radius: 16px;
    color: var(--up-text);
}

.modal-header {
    border-bottom: 1px solid var(--up-border);
    padding: 1.2rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 700;
    color: #fff;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-footer {
    border-top: 1px solid var(--up-border);
    padding: 1rem 1.5rem;
}

/* ============ FOOTER ============ */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--up-text-muted);
    font-size: 0.8rem;
    border-top: 2px solid;
    border-image: linear-gradient(90deg, transparent, #1a5cd6, #e63946, transparent) 1;
    margin-top: 2rem;
}

.footer a {
    color: var(--up-blue-light);
    text-decoration: none;
}

/* ============ SORT ORDER ============ */
.sort-order {
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--up-text-muted);
    font-weight: 600;
}

/* ============ API INFO ============ */
.api-info-card {
    border: 1px dashed rgba(26, 92, 214, 0.4);
    background: linear-gradient(135deg, rgba(26, 92, 214, 0.05), rgba(230, 57, 70, 0.03));
}

.api-url-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(26, 92, 214, 0.3);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #4a8eff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.api-url-box .btn-copy {
    background: linear-gradient(135deg, rgba(26, 92, 214, 0.3), rgba(230, 57, 70, 0.2));
    border: 1px solid rgba(26, 92, 214, 0.4);
    color: #4a8eff;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.api-url-box .btn-copy:hover {
    background: linear-gradient(135deg, rgba(26, 92, 214, 0.5), rgba(230, 57, 70, 0.3));
    color: #fff;
}

/* ============ RESPONSIVO ============ */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .navbar-brand .navbar-logo {
        height: 32px;
    }
}
