/* Admin Panel Styles */
:root {
    --admin-sidebar-width: 250px;
    --admin-sidebar-bg: #1f2937;
    --admin-sidebar-text: #d1d5db;
    --admin-sidebar-hover: #374151;
    --admin-sidebar-active: #3b82f6;
    --admin-header-bg: #ffffff;
    --admin-header-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --admin-content-bg: #f9fafb;
}

/* Admin-specific body styles - only apply to admin pages */
body.admin-page {
    font-family: 'Inter', sans-serif;
    background: var(--admin-content-bg);
    margin: 0;
    padding: 0;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.admin-sidebar {
    width: var(--admin-sidebar-width);
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.admin-overlay.show {
    display: block;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #374151;
    text-align: center;
}

.admin-sidebar-header h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.admin-sidebar-header .logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.admin-sidebar-nav {
    padding: 1rem 0 2rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Custom scrollbar for sidebar */
.admin-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar-nav::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 3px;
}

.admin-sidebar-nav::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.admin-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Firefox scrollbar */
.admin-sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: #6b7280 #374151;
}

.admin-nav-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.admin-nav-item:hover {
    background: var(--admin-sidebar-hover);
    color: white;
    text-decoration: none;
}

.admin-nav-item.active {
    background: var(--admin-sidebar-hover);
    color: white;
    border-left-color: var(--admin-sidebar-active);
}

.admin-nav-item i {
    width: 20px;
    margin-right: 0.75rem;
}

.admin-sidebar-logout {
    border-top: 1px solid #374151;
    flex-shrink: 0;
}

.admin-sidebar-logout .admin-nav-item {
    color: #ef4444;
    border-left: none;
}

.admin-sidebar-logout .admin-nav-item:hover {
    background: #dc2626;
    color: white;
}

.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    transition: all 0.3s ease;
    width: calc(100% - var(--admin-sidebar-width));
    overflow-x: hidden;
}

/* When sidebar is collapsed, adjust main content */
.admin-sidebar.collapsed + .admin-main {
    margin-left: 0;
    width: 100%;
}

/* Alternative approach for better compatibility */
.admin-layout.sidebar-collapsed .admin-main {
    margin-left: 0;
    width: 100%;
}

/* Ensure content area adjusts properly when sidebar is collapsed */
.admin-layout.sidebar-collapsed .admin-content {
    width: 100%;
    max-width: 100%;
}

.admin-header {
    background: var(--admin-header-bg);
    box-shadow: var(--admin-header-shadow);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-sidebar-toggle {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.admin-sidebar-toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border-radius: 10px;
}

.admin-user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.admin-user-details h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.admin-user-details small {
    color: #6b7280;
    font-size: 0.8rem;
}

.admin-logout-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.admin-logout-btn:hover {
    background: #b91c1c;
    color: white;
    text-decoration: none;
}

.admin-content {
    padding: 2rem;
}

.admin-page-header {
    margin-bottom: 2rem;
}

.admin-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.admin-page-subtitle {
    color: #6b7280;
    margin: 0.5rem 0 0 0;
}

/* Admin Dashboard Styles */
.admin-dashboard {
    padding: 0;
}

/* Admin Stat Cards - Multiple Variations */
.admin-stat-card {
    background: var(--light-card);
    border: 1px solid var(--light-border);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    height: 100%;
    min-height: 120px;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* Gradient Stat Cards (for payouts, shortlinks, faucet) */
.admin-stat-card.gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.admin-stat-card.gradient:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-content p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Gradient stat cards content */
.admin-stat-card.gradient .stat-content h3 {
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.admin-stat-card.gradient .stat-content p {
    color: white;
    opacity: 0.9;
    font-size: 0.9rem;
}

.admin-stat-card.gradient .stat-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.2);
}

/* Admin Cards */
.admin-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.5rem 1.5rem 0;
    border-bottom: none;
}

.card-header h5 {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Admin Table Styles - scoped to admin pages */
.admin-card .table {
    margin-bottom: 0;
}

.admin-card .table th {
    border-top: none;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-card .table td {
    border-top: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: #6b7280;
}

.admin-card .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

/* Admin Form Styles - scoped to admin pages */
.admin-card .form-label {
    font-weight: 600;
    color: #495057;
}

.admin-card .text-danger {
    color: #dc3545 !important;
}

.admin-card .form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.admin-card .btn {
    border-radius: 6px;
}

.gap-2 {
    gap: 0.5rem !important;
}

/* Admin Login Styles */
.admin-login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 400px;
    width: 100%;
    margin: 20px;
}

.admin-login-header {
    background: #ffffff;
    color: #1f2937;
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.admin-login-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
}

.admin-login-header p {
    margin: 0.5rem 0 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.admin-login-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 3rem;
}

.input-group-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 5;
}

.btn-admin-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-admin-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    color: white;
}

.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.admin-footer {
    text-align: center;
    padding: 1rem 2rem 2rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.admin-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.admin-footer a:hover {
    text-decoration: underline;
}

/* User Avatar */
.user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

/* Button Groups */
.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Tablet and smaller screens - make sidebar overlay */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .admin-content {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .admin-overlay.show {
        display: block;
    }
    
    /* Ensure dashboard content is responsive */
    .admin-dashboard {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .admin-dashboard .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .admin-dashboard .col-md-3,
    .admin-dashboard .col-md-6 {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 1rem;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .admin-content {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .admin-overlay.show {
        display: block;
    }
    
    /* Ensure dashboard content is responsive */
    .admin-dashboard {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .admin-dashboard .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .admin-dashboard .col-md-3,
    .admin-dashboard .col-md-6 {
        padding-left: 0;
        padding-right: 0;
        margin-bottom: 1rem;
    }
    
    /* Stat cards mobile */
    .admin-stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .admin-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .d-flex.justify-content-end {
        flex-direction: column;
    }
    
    .gap-2 {
        gap: 0.25rem !important;
    }
}

@media (max-width: 576px) {
    .admin-stat-card {
        padding: 1rem;
    }
    
    .stat-content h3 {
        font-size: 1.25rem;
    }
    
    .stat-content p {
        font-size: 0.8rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem;
        font-size: 0.75rem;
    }
}
