:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #0f172a;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    --dark: #121212;
    --darker: #0a0a0a;
    --light: #f8f9fa;
    --gray: #64748b;
    --gray-light: #f1f5f9;
    --gray-dark: #334155;
    --border: #3a3a3a;
    --card-bg: #1a1a1a;
    --hover: #2a2a2a;
    --premium-gold: #ffd700;
    --premium-purple: #9d4edd;
    --admin-primary: #8b5cf6;
    --admin-dark: #7c3aed;
    --radius-card: 16px;
    --radius-btn: 10px;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
    color: var(--light);
    min-height: 100vh;
    line-height: 1.6;
    background-attachment: fixed; /* Fixa o gradiente */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px); /* Adiciona efeito blur */
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-top h1 {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; /* Adiciona suporte para outros navegadores */
    font-size: clamp(1.5rem, 4vw, 2rem); /* Responsivo */
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.premium-badge {
    background: linear-gradient(45deg, var(--premium-gold), var(--warning));
    color: var(--dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
    white-space: nowrap;
}

.header-tabs {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.main-tab-btn {
    background: var(--gray);
    border: 2px solid transparent;
    color: var(--light);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.main-tab-btn:hover {
    background: var(--hover);
    transform: translateY(-2px);
}

.main-tab-btn.active {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-color: var(--info);
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.4);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; /* Previne overflow */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.2rem, 3vw, 1.4rem);
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-badge.online {
    background: linear-gradient(45deg, var(--success), #00ff95);
    color: #000;
}

.status-badge.warning {
    background: linear-gradient(45deg, var(--warning), #ff8c00);
    color: #000;
}

.status-badge.danger {
    background: linear-gradient(45deg, var(--danger), #ff4b2b);
    color: #fff;
}

.status-badge.info {
    background: linear-gradient(45deg, var(--info), #4cc9f0);
    color: #000;
}

.status-badge.success {
    background: linear-gradient(45deg, var(--success), #38ef7d);
    color: #000;
}

/* Status Dots */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin: 0 5px;
    vertical-align: middle; /* Alinha verticalmente */
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-dot.warning {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

.status-dot.danger {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

/* System Status */
.system-status .status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.status-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.status-item i {
    font-size: 1.5rem;
    color: var(--info);
    flex-shrink: 0; /* Previne compressão do ícone */
}

.status-value {
    font-weight: bold;
    margin-left: auto;
    white-space: nowrap;
}

/* Device Info */
.device-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.info-item .label {
    display: block;
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.info-item .value {
    font-weight: bold;
    color: var(--light);
    word-break: break-word; /* Quebra palavras longas */
}

/* FRP Section */
.frp-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--gray);
    border: none;
    color: var(--light);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-btn:hover {
    background: var(--hover);
}

.tab-btn.active {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
}

.frp-content {
    display: none;
}

.frp-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.server-selector {
    margin-bottom: 20px;
}

.server-select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.server-select:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.frp-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Action Buttons */
.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 44px; /* Tamanho mínimo para acessibilidade */
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.premium {
    background: linear-gradient(45deg, var(--premium-gold), var(--warning));
    color: #000;
}

.action-btn.success {
    background: linear-gradient(45deg, var(--success), #38ef7d);
    color: #000;
}

.action-btn.info {
    background: linear-gradient(45deg, var(--info), #4cc9f0);
    color: #000;
}

.action-btn.warning {
    background: linear-gradient(45deg, var(--warning), #ff8c00);
    color: #000;
}

.action-btn.danger {
    background: linear-gradient(45deg, var(--danger), #ff4b2b);
    color: #fff;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Servers Section */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.server-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.server-card:hover {
    transform: translateY(-5px);
    border-color: var(--info);
}

.server-card.premium {
    border: 2px solid var(--premium-gold);
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), rgba(255, 179, 71, 0.1));
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.server-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

.server-status.online {
    background: var(--success);
    color: #000;
}

.server-status.warning {
    background: var(--warning);
    color: #000;
}

.server-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    color: #aaa;
    flex-wrap: wrap;
}

.server-connect-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: auto; /* Empurra o botão para baixo */
    transition: all 0.3s ease;
    font-weight: 600;
}

.server-connect-btn:hover {
    transform: scale(1.05);
}

.server-connect-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* API Manager */
.api-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.api-info h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.api-btn {
    padding: 8px 16px;
    background: var(--info);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.api-btn:hover {
    background: var(--primary);
}

.api-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Shop */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--info);
}

.product-image {
    width: 100%;
    height: 150px;
    background: var(--gray);
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
}

/* Security Grid */
.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.security-module {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
}

.security-module:hover {
    background: rgba(255, 255, 255, 0.08);
}

.module-status {
    margin-top: 10px;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}

.module-status.online {
    background: var(--success);
    color: #000;
}

/* Support Chat */
.support-chat {
    display: flex;
    flex-direction: column;
    height: 400px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.chat-send-btn {
    padding: 12px 24px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Update Center */
.update-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.update-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.update-btn {
    padding: 8px 20px;
    background: var(--success);
    color: #000;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.update-btn:hover {
    background: #38ef7d;
}

.update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #aaa;
}

/* Profile Section */
.profile-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
}

.avatar-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-section img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--info);
    margin-bottom: 15px;
    object-fit: cover; /* Previne distorção da imagem */
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-form input {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.profile-form input:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.save-btn {
    padding: 12px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.save-btn:hover {
    transform: scale(1.02);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Footer */
footer {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    color: #aaa;
    border-top: 1px solid var(--border);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--info);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 100%;
    border: 1px solid var(--border);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--light);
    background: rgba(255, 255, 255, 0.1);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* IMEI Terminal */
.imei-terminal {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    padding: 15px;
    border-radius: 8px;
    height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.log-line {
    margin-bottom: 5px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Logout Button */
.logout-btn {
    padding: 10px 20px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #ff4b2b;
    transform: scale(1.05);
}

.logout-btn:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .profile-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .avatar-section {
        order: -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .header-tabs {
        overflow-x: auto;
        padding-bottom: 10px;
        margin-top: 15px;
        -webkit-overflow-scrolling: touch;
    }
    
    .main-tab-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .device-info-grid,
    .frp-buttons-grid,
    .servers-grid,
    .shop-grid,
    .security-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .chat-input {
        flex-direction: column;
    }
    
    .chat-send-btn {
        width: 100%;
    }
    
    .api-item,
    .update-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .api-status {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 15px;
    }
    
    .status-grid {
        grid-template-columns: 1fr !important;
    }
    
    .frp-tabs {
        justify-content: center;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
    
    .action-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Focus Styles para acessibilidade */
:focus-visible {
    outline: 2px solid var(--info);
    outline-offset: 2px;
}

/* Prevenir seleção de texto não necessário */
.no-select {
    user-select: none;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--info);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Tooltip básico */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: var(--light);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 100;
    border: 1px solid var(--border);
}