/* =====================================================
   SUPER API PANEL - MODERN CSS DESIGN
   ===================================================== */

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #06d6a0;
    --danger: #ef476f;
    --warning: #ffd166;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --dark-gray: #343a40;
    --gradient: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
    --gradient-success: linear-gradient(135deg, #06d6a0 0%, #118ab2 100%);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    overflow-x: hidden;
}

/* =====================================================
   LOGIN & REGISTER PAGES
   ===================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.4);
}

.login-logo .logo-icon i {
    font-size: 35px;
    color: white;
}

.login-logo h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    display: block;
}

.input-group-custom {
    position: relative;
}

.input-group-custom i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 18px;
}

.input-group-custom input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    transition: all 0.3s;
    background: #f8fafc;
}

.input-group-custom input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #a0aec0;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    width: 100%;
    color: white;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.5);
}

/* =====================================================
   SIDEBAR STYLES
   ===================================================== */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header .logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.sidebar-header .logo-icon i {
    font-size: 28px;
    color: #0f172a;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #fff 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header p {
    font-size: 11px;
    opacity: 0.6;
}

.user-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 100%);
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #0f172a;
}

.user-info strong {
    display: block;
    font-size: 14px;
    color: white;
}

.user-info span {
    font-size: 11px;
    opacity: 0.7;
}

.menu-category {
    padding: 15px 20px 5px 20px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
    margin: 2px 10px;
    border-radius: 10px;
}

.menu-link i {
    font-size: 18px;
    width: 24px;
}

.menu-link:hover {
    color: white;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.15) 0%, transparent 100%);
    transform: translateX(5px);
}

.menu-link.active {
    color: #fbbf24;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.2) 0%, transparent 100%);
    border-left: 3px solid #fbbf24;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(15,23,42,0.95) 0%, #0f172a 100%);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    margin-left: 280px;
    padding: 25px 30px;
    transition: all 0.3s;
}

/* Top Header */
.top-header {
    background: white;
    border-radius: 20px;
    padding: 20px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.welcome h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.welcome p {
    color: #64748b;
    font-size: 13px;
    margin: 5px 0 0;
}

.admin-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.stat-icon i {
    font-size: 24px;
    color: #f59e0b;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 5px;
}

.stat-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

/* Service Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.service-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eef2f6;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.service-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #4361ee15 0%, #7209b715 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.service-icon i {
    font-size: 28px;
    color: #4361ee;
}

.service-name {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 5px;
}

.service-price {
    font-size: 20px;
    font-weight: 800;
    color: #f59e0b;
}

.service-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 10px;
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 20px;
    padding: 25px;
    color: white;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(45deg);
}

.balance-card h3 {
    font-size: 36px;
    font-weight: 800;
    margin: 10px 0 5px;
}

/* API Key Box */
.api-key-box {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
    border: 1px solid #e2e8f0;
}

/* Tables */
.table-wrapper {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eef2f6;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 15px 20px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 12px 20px;
    font-size: 13px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tr:hover {
    background: #fafbff;
}

/* Status Badges */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
}

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

.btn-success {
    background: linear-gradient(135deg, #06d6a0, #059669);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef476f, #dc2626);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffd166, #f59e0b);
    color: #1e293b;
}

/* Modal */
.modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #4361ee, #7209b7);
    color: white;
    border: none;
    padding: 18px 25px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast-custom {
    background: white;
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}

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

.toast-success {
    border-left: 4px solid #06d6a0;
}

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

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1002;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
        margin-top: 70px;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .top-header {
        flex-direction: column;
        text-align: center;
    }
    
    .login-card {
        margin: 20px;
        padding: 30px 25px;
    }
}