/**
 * @author Jukaza
 * @copyright Copyright (c) 2023
 * @contact Email: jukaza208@gmail.com | Facebook: https://www.facebook.com/profile.php?id=100076560932270 | Zalo: 0385436233
 * @license Proprietary
 * @version 1.0.0
 * @description File này thuộc quyền sở hữu của Jukaza. Nghiêm cấm sao chép khi chưa được phép.
 */

/* Player Profile Styles */
:root {
    --player-primary: var(--accent-color, #ff7700);
    --player-primary-dark: var(--link-hover, #e65c00);
    --player-primary-light: #ff9d4d;
    --player-secondary: #4a89dc;
    --player-secondary-dark: #3b6eb4;
    --player-success: #37bc9b;
    --player-warning: #f6bb42;
    --player-danger: #da4453;
    --player-light: #f5f7fa;
    --player-dark: #333;
    --player-gray: #aab2bd;
    --player-border: #e6e9ed;
    --player-shadow: rgba(0, 0, 0, 0.1);
    --player-card-bg: #fff;
    --player-text: #333;
    --player-text-secondary: #666;
}

[data-theme="dark"] {
    --player-light: #1a1a1a;
    --player-dark: #f5f7fa;
    --player-gray: #8c8c8c;
    --player-border: #444;
    --player-shadow: rgba(0, 0, 0, 0.3);
    --player-card-bg: #2c2c2c;
    --player-text: #f0f0f0;
    --player-text-secondary: #aaa;
}

/* Player Profile Container */
.player-profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

/* Profile Header */
.profile-header {
    position: relative;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 5px 15px var(--player-shadow);
    background-color: var(--player-card-bg);
    transition: all 0.3s ease;
    padding-bottom: 20px;
}

.profile-banner {
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.profile-avatar-container {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 120px;
    height: 120px;
}

.profile-avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid var(--player-card-bg);
    box-shadow: 0 5px 15px var(--player-shadow);
    overflow: hidden;
    background-color: var(--player-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fallback avatar */
.profile-avatar-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    z-index: -1;
}

[data-theme="dark"] .profile-avatar-wrapper::before {
    background-color: #333;
}

.default-avatar-icon {
    position: absolute;
    font-size: 50px;
    color: #aaa;
    opacity: 0;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .default-avatar-icon {
    color: #666;
}

.profile-avatar-wrapper.no-avatar .default-avatar-icon {
    opacity: 1;
}

.profile-avatar {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}

/* Level display is now in profile-basic-info */

.profile-basic-info {
    padding: 80px 20px 20px;
    text-align: center;
    position: relative;
    z-index: 5;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--player-text);
}

.profile-vip-display,
.profile-planet,
.profile-creation-date {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    font-size: 16px;
    color: var(--player-text-secondary);
}

.profile-vip-display i,
.profile-planet i,
.profile-creation-date i {
    margin-right: 8px;
    font-size: 18px;
}

.profile-vip-display i {
    color: #aaa;
}

.profile-vip-display.vip-active i {
    color: #f1c40f;
}

.profile-vip-display.vip-active span {
    color: #f1c40f;
    font-weight: 600;
}

/* Profile creation date styling is now combined with other profile info elements */

/* Profile Body */
.profile-body {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

/* Mobile Stats Toggle */
.mobile-stats-toggle {
    display: none;
    margin-bottom: 15px;
}

#toggle-stats-btn {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--player-card-bg);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--player-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 500;
    color: var(--player-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

#toggle-stats-btn i:first-child {
    margin-right: 10px;
    color: var(--player-primary);
}

#toggle-stats-btn:hover {
    background-color: var(--player-primary-light);
    color: white;
}

#toggle-stats-btn.active {
    background-color: var(--player-primary);
    color: white;
}

/* Stats Sidebar */
.profile-sidebar {
    flex: 1;
    max-width: 350px;
}

.stats-card {
    background-color: var(--player-card-bg);
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--player-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--player-shadow);
}

.stats-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--player-text);
    position: relative;
    padding-bottom: 10px;
}

.stats-card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--player-primary);
    border-radius: 3px;
}

/* Top-up Button */
.topup-button {
    display: block;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    margin: 15px 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
    text-decoration: none;
}

.topup-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4);
    background: linear-gradient(135deg, #27ae60, #219653);
}

.topup-button i {
    margin-right: 8px;
    font-size: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

[data-theme="dark"] .stat-item {
    background-color: rgba(255, 255, 255, 0.05);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px var(--player-shadow);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    font-size: 18px;
}

.stat-info {
    flex: 1;
}

.stat-name {
    font-size: 14px;
    color: var(--player-text-secondary);
    margin-bottom: 3px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--player-text);
}

/* Resource List */
.resource-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.resource-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

[data-theme="dark"] .resource-item {
    background-color: rgba(255, 255, 255, 0.05);
}

.resource-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px var(--player-shadow);
}

.resource-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 20px;
}

.resource-icon.gold {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.resource-icon.gem {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.resource-icon.potential {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.resource-icon.cash {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.resource-info {
    flex: 1;
}

.resource-name {
    font-size: 14px;
    color: var(--player-text-secondary);
    margin-bottom: 3px;
}

.resource-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--player-text);
}

/* Profile Content */
.profile-content {
    flex: 2;
}

.profile-tabs {
    display: flex;
    background-color: var(--player-card-bg);
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--player-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.profile-tab {
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--player-text-secondary);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 2px;
}

.profile-tab i {
    font-size: 20px;
    margin-bottom: 5px;
}

.profile-tab:hover {
    color: #ffffff;
    background-color: var(--player-primary);
    box-shadow: 0 2px 8px rgba(255, 119, 0, 0.3);
    transform: translateY(-1px);
}

[data-theme="dark"] .profile-tab:hover {
    background-color: var(--player-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 119, 0, 0.4);
}

.profile-tab.active {
    color: var(--player-primary);
    font-weight: 600;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--player-primary);
}

.tab-contents {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Info Card */
.info-card {
    background-color: var(--player-card-bg);
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--player-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--player-shadow);
}

.info-card-title {
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--player-text);
    border-bottom: 1px solid var(--player-border);
    margin: 0;
}

.info-card-content {
    padding: 20px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    align-items: center;
}

.info-label {
    font-weight: 500;
    color: var(--player-text-secondary);
    margin-right: 10px;
    min-width: 100px;
}

.info-value {
    font-weight: 600;
    color: var(--player-text);
}

.info-value.vip-active {
    color: #f1c40f;
}


/* Character Progress */
.character-progress {
    margin-top: 20px;
}

.character-progress h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--player-text);
}

/* New Character Status */
.new-character-status {
    display: flex;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

[data-theme="dark"] .new-character-status {
    background-color: rgba(255, 255, 255, 0.05);
}

.status-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.status-icon i {
    font-size: 22px;
    color: white;
}

.status-info {
    flex: 1;
}

.status-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--player-text);
    margin-bottom: 5px;
}

.status-description {
    font-size: 14px;
    color: var(--player-text-secondary);
    margin-bottom: 10px;
}

.highlight {
    color: #e74c3c;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

[data-theme="dark"] .progress-bar {
    background-color: rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-days {
    text-align: right;
    font-size: 14px;
    color: var(--player-text-secondary);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 50px;
    color: var(--player-gray);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--player-text-secondary);
    margin-bottom: 20px;
    font-size: 16px;
}

.action-button {
    background-color: var(--player-primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.action-button i {
    margin-right: 8px;
}

.action-button:hover {
    background-color: var(--player-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb, 255, 119, 0), 0.3);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .profile-body {
        flex-direction: column;
    }

    .profile-sidebar {
        max-width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-stats-toggle {
        display: block;
    }

    .profile-sidebar {
        display: none;
    }

    .profile-sidebar.active {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .profile-tab span {
        display: none;
    }

    .profile-tab i {
        margin-bottom: 0;
        font-size: 22px;
    }
}

@media (max-width: 576px) {
    .profile-banner {
        height: 150px;
    }

    .profile-avatar-wrapper {
        width: 100px;
        height: 100px;
    }

    .profile-avatar-container {
        top: 100px;
        width: 100px;
        height: 100px;
    }

    .profile-basic-info {
        padding: 70px 15px 15px;
    }

    .default-avatar-icon {
        font-size: 40px;
    }

    .new-character-status {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .status-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .progress-days {
        text-align: center;
    }
}

    .profile-name {
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .info-card-title,
    .info-card-content {
        padding: 15px;
    }

    .info-label {
        min-width: 80px;
    }
}

/* Inventory Styles - Compact Grid */
.inventory-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
    padding: 10px 0 !important;
}

.inventory-item {
    background: linear-gradient(135deg, #2c3e50, #34495e) !important;
    border: 1px solid #4a5568 !important;
    border-radius: 8px !important;
    padding: 8px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 60px !important;
    width: auto !important;
    margin: 0 !important;
}

.inventory-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: #3498db;
}

.inventory-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #e74c3c);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inventory-item:hover::before {
    opacity: 1;
}

.item-icon {
    text-align: center;
    position: relative;
    margin-bottom: 4px;
}

.item-icon img {
    max-width: 32px;
    max-height: 32px;
    width: auto;
    height: auto;
    border-radius: 6px;
    border: 1px solid #4a5568;
    transition: all 0.3s ease;
    object-fit: contain;
}

.inventory-item:hover .item-icon img {
    border-color: #3498db;
    transform: scale(1.1);
}

.item-fallback-icon {
    max-width: 32px;
    max-height: 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 6px;
    color: white;
    font-size: 14px;
    border: 1px solid #4a5568;
    object-fit: contain;
}

.item-info {
    text-align: center;
    display: none; /* Ẩn thông tin chi tiết */
}

.item-quantity {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: #ecf0f1;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

.item-name,
.item-time,
.item-options {
    display: none; /* Ẩn tất cả thông tin khác */
}

/* Mobile responsive for inventory */
@media (max-width: 1200px) {
    .inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .inventory-item {
        padding: 6px;
        min-height: 50px;
    }
    
    .item-icon img {
        max-width: 28px;
        max-height: 28px;
        width: auto;
        height: auto;
    }
    
    .item-fallback-icon {
        max-width: 28px;
        max-height: 28px;
        width: 28px;
        height: 28px;
    }
    
    .item-quantity {
        font-size: 9px;
        padding: 1px 3px;
    }
}

@media (max-width: 480px) {
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Force override any conflicting styles */
.inventory-grid * {
    box-sizing: border-box !important;
}

.inventory-grid .inventory-item {
    float: none !important;
    clear: none !important;
    width: auto !important;
    display: flex !important;
}

/* Item Details Tab Styles */
.item-details-tab {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-details-tab.active {
    opacity: 1;
}

.item-details-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 2px solid #4a5568;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.item-details-tab.active .item-details-content {
    transform: scale(1);
}

.item-details-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #4a5568;
    gap: 15px;
}

.item-details-icon img {
    border-radius: 8px;
    border: 2px solid #4a5568;
}

.item-details-info {
    flex: 1;
}

.item-details-body {
    padding: 20px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 4px 0;
}

.detail-label {
    color: #bdc3c7;
    font-size: 12px;
}

.detail-value {
    color: #ecf0f1;
    font-size: 12px;
    font-weight: 500;
}

.detail-options {
    max-height: 120px;
    overflow-y: auto;
}

.option-item {
    background: rgba(52, 73, 94, 0.5);
    border: 1px solid #4a5568;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-item:last-child {
    margin-bottom: 0;
}

.option-id {
    color: #3498db;
    font-size: 11px;
    font-weight: 600;
}

.option-param {
    color: #e74c3c;
    font-size: 11px;
    font-weight: 500;
}

/* Mobile responsive for item details */
@media (max-width: 768px) {
    .item-details-content {
        max-width: 350px;
        width: 95%;
    }
    
    .item-details-header {
        padding: 15px;
        gap: 10px;
    }
    
    .item-details-body {
        padding: 15px;
    }
    
    .item-details-icon img {
        width: 40px;
        height: 40px;
    }
}
