:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --bg-dark: #0f172a;
    --bg-surface: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(30, 41, 59, 0.7);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Admin Table Styling - Modern Glassmorphism */
.admin-table-wrapper {
    background: rgba(30, 30, 35, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}
.admin-table th, .admin-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.admin-table th {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}
.admin-table tbody tr {
    transition: all 0.2s ease;
}
.admin-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
    transform: translateY(-1px);
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.badge-pending { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05)); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-completed, .badge-active { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05)); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.badge-failed, .badge-rejected { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05)); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

/* Small Buttons */
.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}
.btn-sm i { font-size: 0.85rem; }
.btn-sm-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}
.btn-sm-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
}
.btn-sm-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}
.btn-sm-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}
.btn-sm-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}
.btn-sm-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}
.btn-sm-outline {
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-sm-outline:hover {
    background: rgba(255,255,255,0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Navbar */
.main-navbar {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 8px;
}

.user-menu {
    position: relative;
}
.user-menu > a {
    display: flex;
    align-items: center;
}
.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 0;
    list-style: none;
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
}
.dropdown li a {
    display: block;
    padding: 8px 20px;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.3s;
}
.dropdown li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}
.user-menu:hover .dropdown {
    display: block;
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

/* Canvas Area */
.canvas-wrapper {
    position: relative;
    width: 100%;
    height: calc(100vh - 175px);
    overflow: hidden;
    background: #000;
    cursor: crosshair;
    touch-action: none;
}

#mainCanvas {
    position: absolute;
    top: 0;
    left: 0;
    image-rendering: pixelated;
}

/* Floating UI Components */
.floating-minimap {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    background: #000;
    border: 2px solid var(--bg-surface);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    z-index: 100;
}
#minimapCanvas {
    width: 100%;
    height: 100%;
}

.floating-zoom {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
    overflow: hidden;
}
.floating-zoom button {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.floating-zoom button:hover {
    background: rgba(255,255,255,0.1);
    color: var(--primary);
}
.floating-zoom .divider {
    height: 1px;
    background: var(--border);
    width: 100%;
}

.floating-tools {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}
.tool-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.2s;
}
.tool-btn:hover {
    transform: scale(1.05);
}
.tool-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Forms */
.payment-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

.auth-card {
    max-width: 400px;
    margin: 80px auto;
    background: var(--bg-surface);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
}

/* Responsive */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Admin Dashboard Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        display: none;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .canvas-wrapper {
        height: calc(100vh - 120px); /* Tighter fit on mobile */
    }
    
    .canvas-header {
        display: none; /* Hide header text on mobile to maximize space */
    }
    
    /* Adjust Floating UI for Mobile */
    .floating-minimap {
        width: 100px;
        height: 100px;
        bottom: 15px;
        right: 15px;
    }
    .floating-zoom {
        bottom: 15px;
        left: 15px;
    }
    .floating-tools {
        top: 15px;
        right: 15px;
    }

    /* Bottom Sheet Selection Panel */
    #selection-panel {
        top: auto !important;
        bottom: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: none !important;
        padding: 25px 20px !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5) !important;
        transform: translateY(100%);
        animation: slideUp 0.3s forwards;
    }

    @keyframes slideUp {
        to { transform: translateY(0); }
    }
    
    /* Hide tooltip on mobile entirely */
    #ad-tooltip {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: rgba(15, 15, 20, 0.95);
        backdrop-filter: blur(10px);
        padding: 20px 0;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }
    .user-menu {
        justify-content: center;
    }
    .dropdown {
        position: static;
        box-shadow: none;
        background: transparent;
        display: none; /* Changed from block to display properly */
        opacity: 1;
        visibility: visible;
        transform: none;
        padding-top: 10px;
    }
    .user-menu:hover .dropdown {
        display: block;
    }
}
