/* Admin Panel Styles for LilyBlock Online Shop */

/* --- Core Admin UI Components --- */

/* Admin Button in Navigation */
.admin-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 53, 0.3);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.admin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.admin-btn:hover::before {
    left: 100%;
}

.admin-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Admin Menu Item */
.user-menu-item.admin-menu-item {
    color: #ff6b35;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 107, 53, 0.15);
    margin-bottom: 8px;
}

.user-menu-item.admin-menu-item:hover {
    background: linear-gradient(90deg, 
        rgba(255, 107, 53, 0.1), 
        rgba(247, 147, 30, 0.1)
    );
    color: #f7931e;
    border-bottom-color: rgba(255, 107, 53, 0.3);
}

.user-menu-item.admin-menu-item::before {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 107, 53, 0.15), 
        transparent
    );
}

/* --- Admin Modal Structure --- */

.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 2500;
}

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

/* Consolidated Admin Content Styles */
.admin-content, 
.admin-modal .modal-content {
    background: linear-gradient(145deg, var(--dark-bg), rgba(10, 10, 26, 0.95));
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 28px;
    padding: 40px;
    
    /* Sizing & Positioning */
    max-width: 1200px;
    width: 95vw;
    max-height: 90vh;
    margin: 50px auto;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    
    /* Effects */
    backdrop-filter: blur(25px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 107, 53, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
        
    box-sizing: border-box;
}

.admin-modal .close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    z-index: 10;
}

.admin-modal .close:hover {
    color: var(--roblox-red);
    transform: scale(1.1);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 107, 53, 0.2);
}

.admin-header h2 {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.2rem;
    margin: 0;
}

.admin-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #10b981, #059669);
}

.admin-level-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-level-badge.level-3 {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

.admin-level-badge.level-2 {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: white;
    box-shadow: 0 0 15px rgba(234, 88, 12, 0.3);
}

.admin-level-badge.level-1 {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    color: white;
    box-shadow: 0 0 15px rgba(8, 145, 178, 0.3);
}

/* --- Admin Tabs --- */
.admin-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 25px;
    flex-wrap: wrap; /* Allow tabs to wrap on small screens */
}

.admin-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.admin-tab.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.admin-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* --- Admin Content Area --- */
.admin-content-area {
    /* max-height removed to allow modal to scroll naturally */
    padding-right: 5px;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.admin-section-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.add-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* --- Admin Orders List --- */
.admin-orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-order-item {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.admin-order-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

/* --- Admin Items List --- */
.admin-items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.admin-item {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 15px;
    transition: all 0.3s ease;
}

.admin-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

.admin-item-info {
    margin-bottom: 15px;
}

.admin-item-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.admin-item-game {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.admin-item-price {
    font-weight: 700;
    color: var(--success-green);
    margin-bottom: 5px;
}

.admin-item-rarity {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-item-actions {
    display: flex;
    gap: 10px;
}

.edit-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    padding: 6px 12px;
    font-size: 0.8rem;
    flex: 1;
}

.delete-btn {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    padding: 6px 12px;
    font-size: 0.8rem;
    flex: 1;
}

/* --- Admin Customers List --- */
.admin-customers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-customer-item {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-customer-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

.admin-customer-email {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.admin-customer-username {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-customer-stats {
    display: flex;
    gap: 20px;
}

.admin-customer-stat {
    text-align: center;
}

.admin-customer-stat .stat-value {
    font-weight: 700;
    color: var(--accent-blue);
    display: block;
}

.admin-customer-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.admin-customer-dates {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
}

/* --- Admin Analytics (Fixed) --- */
.analytics-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.analytics-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.analytics-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
    box-sizing: border-box;
}

.analytics-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-2px);
}

.analytics-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 10px;
}

.analytics-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent-blue);
}

.analytics-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analytics-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.analytics-list li:last-child {
    border-bottom: none;
}

.analytics-list li span {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Admin Filters --- */
.admin-filters select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.admin-filters select:hover, .admin-filters select:focus {
    border-color: #f1c40f;
    background: rgba(0, 0, 0, 0.5);
}

/* --- Refined Admin Order Card Styles --- */
.admin-order-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.admin-order-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.order-id-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1c40f;
    font-family: monospace;
}

.order-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.order-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.order-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.status-pending { background: rgba(241, 196, 15, 0.15); color: #f1c40f; border: 1px solid rgba(241, 196, 15, 0.3); }
.status-processing { background: rgba(52, 152, 219, 0.15); color: #3498db; border: 1px solid rgba(52, 152, 219, 0.3); }
.status-completed { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.3); }
.status-cancelled { background: rgba(231, 76, 60, 0.15); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.3); }

.order-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.order-items-list {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.order-item-row:last-child {
    border-bottom: none;
}

.order-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 8px;
}

.detail-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.detail-group span {
    color: var(--text-primary);
    font-weight: 500;
}

.order-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.action-btn {
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-process { background: rgba(52, 152, 219, 0.15); color: #3498db; border: 1px solid rgba(52, 152, 219, 0.3); }
.btn-process:hover { background: rgba(52, 152, 219, 0.3); transform: translateY(-2px); }

.btn-complete { background: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.3); }
.btn-complete:hover { background: rgba(46, 204, 113, 0.3); transform: translateY(-2px); }

.btn-cancel { background: rgba(231, 76, 60, 0.15); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.3); }
.btn-cancel:hover { background: rgba(231, 76, 60, 0.3); transform: translateY(-2px); }

/* --- Mobile Responsive Styles --- */
@media (max-width: 900px) {
    .analytics-row {
        flex-direction: column;
        gap: 15px;
    }

    .analytics-card, .analytics-card.wide {
        min-width: 0;
        width: 100%;
        flex: 1 1 auto;
    }
}

@media (max-width: 600px) {
    .admin-header h2 {
        font-size: 1.5rem;
    }
    
    .admin-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-filters {
        width: 100%;
    }
    .admin-filters select {
        width: 100%;
    }
    
    .order-card-header {
        flex-direction: column;
        gap: 10px;
    }
    .order-id-group {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .order-meta {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    .order-actions {
        grid-template-columns: 1fr;
    }
    .action-btn {
        padding: 12px;
    }

    /* Analytics Mobile Fixes */
    .analytics-grid {
        gap: 15px;
    }
    .analytics-card {
        padding: 15px;
    }
    
    /* Force padding on modal content to prevent edge-to-edge */
    .admin-content, 
    .admin-modal .modal-content {
        padding: 20px !important;
        width: 95vw !important;
        max-width: 95vw !important;
    }
}

/* Hide Scrollbars on Mobile */
@media (max-width: 768px) {
    .admin-content::-webkit-scrollbar,
    .admin-content-area::-webkit-scrollbar,
    .admin-modal .modal-content::-webkit-scrollbar {
        display: none;
    }
    
    .admin-content,
    .admin-content-area,
    .admin-modal .modal-content {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
}
