/* ==================== ADMIN PANEL ==================== */

/* Admin Icon Button */
.admin-icon-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.admin-icon-btn:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.5);
}

.admin-icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: adminShine 3s ease-in-out infinite;
}

@keyframes adminShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* Admin Panel Overlay */
.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.admin-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

/* Admin Panel Content */
.admin-panel-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 3px solid var(--p5-red);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    clip-path: polygon(
        0 0, calc(100% - 30px) 0, 100% 30px,
        100% 100%, 30px 100%, 0 calc(100% - 30px)
    );
    box-shadow: 0 0 50px rgba(230, 0, 18, 0.6);
    animation: adminPanelSlideIn 0.3s ease-out;
}

@keyframes adminPanelSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Admin Panel Header */
.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--p5-red) 0%, var(--p5-dark-red) 100%);
    border-bottom: 2px solid var(--p5-white);
}

.admin-panel-header h2 {
    margin: 0;
    color: var(--p5-white);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.close-admin-btn {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 2px solid white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

.close-admin-btn:hover {
    background: white;
    color: var(--p5-red);
    transform: rotate(90deg);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--p5-gray);
    overflow-x: auto;
}

.admin-tab {
    background: rgba(255, 255, 255, 0.1);
    color: var(--p5-light-gray);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    letter-spacing: 1px;
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    white-space: nowrap;
}

.admin-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--p5-white);
}

.admin-tab.active {
    background: var(--p5-red);
    color: var(--p5-white);
    box-shadow: 0 4px 15px rgba(230, 0, 18, 0.4);
}

/* Admin Content */
.admin-content {
    padding: 30px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

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

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

.admin-tab-content h3 {
    color: var(--p5-red);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0 0 20px 0;
    text-transform: uppercase;
}

/* Config Section */
.config-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--p5-red);
}

.config-section label {
    display: inline-block;
    color: var(--p5-light-gray);
    font-weight: 700;
    margin-right: 10px;
    margin-bottom: 5px;
}

.config-section input[type="number"],
.config-section input[type="text"] {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--p5-gray);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 1rem;
    width: 200px;
}

.config-section input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Buttons */
.admin-save-btn,
.admin-add-btn {
    background: linear-gradient(135deg, var(--p5-red) 0%, var(--p5-dark-red) 100%);
    color: white;
    border: 2px solid var(--p5-white);
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    margin-top: 10px;
}

.admin-save-btn:hover,
.admin-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(230, 0, 18, 0.5);
}

/* Item Cards */
.items-list,
.currencies-list,
.rarities-list,
.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-item-card,
.admin-currency-card,
.admin-rarity-card,
.admin-user-card {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(42, 42, 42, 0.95));
    border: 2px solid var(--p5-gray);
    border-left: 4px solid var(--p5-red);
    padding: 20px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
    transition: all 0.3s ease;
}

.admin-item-card:hover,
.admin-currency-card:hover,
.admin-rarity-card:hover,
.admin-user-card:hover {
    border-color: var(--p5-red);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(230, 0, 18, 0.3);
}

.item-header,
.currency-header,
.rarity-header,
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--p5-gray);
}

.item-header h4,
.currency-header h4,
.rarity-header h4,
.user-header h4 {
    margin: 0;
    color: var(--p5-white);
    font-weight: 900;
    font-size: 1.1rem;
}

.rarity-badge {
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 1px;
    clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 100%, 0 100%);
}

.rarity-badge.rarity-mythic { background: #e74c3c; color: white; }
.rarity-badge.rarity-legendary { background: #f1c40f; color: black; }
.rarity-badge.rarity-epic { background: #9b59b6; color: white; }
.rarity-badge.rarity-rare { background: #3498db; color: white; }
.rarity-badge.rarity-uncommon { background: #2ecc71; color: white; }
.rarity-badge.rarity-common { background: #95a5a6; color: white; }

.item-details,
.currency-details,
.rarity-details,
.user-details {
    margin-bottom: 15px;
}

.item-details p,
.currency-details p,
.rarity-details p,
.user-details p {
    margin: 5px 0;
    color: var(--p5-light-gray);
    font-size: 0.9rem;
}

.item-actions,
.currency-actions,
.rarity-actions,
.user-actions {
    display: flex;
    gap: 10px;
}

.item-actions button,
.currency-actions button,
.rarity-actions button,
.user-actions button {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--p5-gray);
    padding: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.item-actions button:hover,
.currency-actions button:hover,
.rarity-actions button:hover,
.user-actions button:hover {
    background: var(--p5-red);
    border-color: var(--p5-red);
}

.item-actions button.danger:hover,
.currency-actions button.danger:hover {
    background: #e74c3c;
    border-color: #e74c3c;
}

/* User Avatar Small */
.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--p5-red);
    margin-right: 10px;
}

/* Search Section */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-section input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--p5-gray);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1rem;
}

.search-section button {
    background: var(--p5-red);
    color: white;
    border: none;
    padding: 10px 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-section button:hover {
    background: var(--p5-dark-red);
    transform: translateY(-2px);
}

/* Notifications */
.admin-notification {
    position: fixed;
    top: 100px;
    right: -400px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 2px solid var(--p5-red);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 10001;
    transition: right 0.3s ease;
    min-width: 250px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.admin-notification.show {
    right: 20px;
}

.admin-notification.success {
    border-color: #2ecc71;
}

.admin-notification.error {
    border-color: #e74c3c;
}

.admin-notification.info {
    border-color: #3498db;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .admin-panel-content {
        width: 95%;
        max-height: 95vh;
    }

    .admin-panel-header {
        padding: 15px 20px;
    }

    .admin-panel-header h2 {
        font-size: 1.2rem;
    }

    .admin-tabs {
        padding: 10px;
    }

    .admin-tab {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .admin-content {
        padding: 20px;
    }

    .items-list,
    .currencies-list,
    .rarities-list,
    .users-list {
        grid-template-columns: 1fr;
    }

    .config-section input[type="number"],
    .config-section input[type="text"] {
        width: 100%;
    }
}

/* Scrollbar Styling */
.admin-content::-webkit-scrollbar {
    width: 8px;
}

.admin-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.admin-content::-webkit-scrollbar-thumb {
    background: var(--p5-red);
    border-radius: 4px;
}

.admin-content::-webkit-scrollbar-thumb:hover {
    background: var(--p5-dark-red);
}
