/**
 * Steam Player Stats - Additional Modules CSS
 * Styles for additional player data modules
 * 
 * 
 */

/* ========================================
   Extended Information Block
======================================== */

.steam-extended-info {
    margin-top: 20px;
    background: #1b2838;
    border-radius: 8px;
    border: 1px solid #2a475e;
    overflow: hidden;
    transition: all 0.3s ease;
}

.steam-extended-info:hover {
    border-color: #67c1f5;
    box-shadow: 0 4px 12px rgba(103, 193, 245, 0.1);
}

.steam-extended-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 16px 20px;
    color: #ffffff;
}

.steam-extended-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.steam-icon-extended::before {
    content: "📊";
    font-size: 18px;
}

.steam-extended-buttons {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    background: #16202d;
}

.steam-module-btn {
    background: #67c1f5;
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.steam-module-btn:hover:not(:disabled) {
    background: #4a9eff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 193, 245, 0.3);
}

.steam-module-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.steam-module-btn:focus {
    outline: 2px solid #67c1f5;
    outline-offset: 2px;
}

/* Спиннер для загрузки в кнопках */
.steam-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: steam-spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes steam-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Контейнер для загруженных модулей */
.steam-modules-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Уведомления об ошибках */
.steam-module-error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3232;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 9999;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   Container and Base Module Styles
======================================== */

.steam-additional-modules {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.steam-module {
    background: #1b2838;
    border-radius: 8px;
    border: 1px solid #2a475e;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.steam-module:hover {
    border-color: #67c1f5;
    box-shadow: 0 4px 12px rgba(103, 193, 245, 0.1);
}

/* ========================================
   Module Header
======================================== */

.steam-module-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.steam-module-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

h3.steam-extended-title {
    color: white;
}

.steam-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.steam-icon-extended::before {
    line-height: 1;
}

.steam-icon-games::before {
    content: "🎮";
    font-size: 18px;
	line-height: 1;
}

.steam-icon-friends::before {
    content: "👥";
    font-size: 18px;
	line-height: 1;
}

.steam-icon-inventory::before {
    content: "🎒";
    font-size: 18px;
	line-height: 1;
}

.steam-module-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.steam-module-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.steam-toggle-icon {
    display: block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #ffffff;
    transition: transform 0.3s ease;
}

.steam-module-toggle.steam-toggle-collapsed .steam-toggle-icon {
    transform: rotate(-90deg);
}

/* ========================================
   Module Content
======================================== */

.steam-module-content {
    padding: 20px;
    background: #16202d;
    color: #c7d5e0;
}

/* ========================================
   Loading State
======================================== */

.steam-module-loading {
    text-align: center;
    padding: 40px 20px;
}

.steam-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #2a475e;
    border-top: 3px solid #67c1f5;
    border-radius: 50%;
    animation: steam-spin 1s linear infinite;
}

.steam-module-loading p {
    margin: 0;
    color: #8f98a0;
    font-size: 14px;
}

/* ========================================
   Error State
======================================== */

.steam-module-error {
    text-align: center;
    padding: 40px 20px;
}

.steam-error-message {
    margin: 0 0 16px;
    color: #ff6b6b;
    font-size: 14px;
}

.steam-retry-btn {
    background: #67c1f5;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.steam-retry-btn:hover {
    background: #4a9eff;
}

/* ========================================
   Statistics Display
======================================== */

.steam-games-stats,
.steam-friends-stats,
.steam-inventory-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.steam-stat-item,
.steam-status-item {
    background: #1b2838;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #2a475e;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.steam-stat-label,
.steam-status-label {
    font-size: 12px;
    color: #8f98a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.steam-stat-value,
.steam-status-value {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.steam-stat-value.steam-online {
    color: #90ee90;
}

/* ========================================
   Section Headers
======================================== */

.steam-section-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    padding-bottom: 8px;
    border-bottom: 2px solid #2a475e;
}

.steam-games-section,
.steam-friends-section,
.steam-inventory-section {
    margin-bottom: 24px;
}

.steam-games-section:last-child,
.steam-friends-section:last-child,
.steam-inventory-section:last-child {
    margin-bottom: 0;
}

/* ========================================
   Games List
======================================== */

.steam-games-list {
    display: grid;
    gap: 12px;
}

.steam-game-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #1b2838;
    border-radius: 6px;
    border: 1px solid #2a475e;
    transition: all 0.2s ease;
}

.steam-game-item:hover {
    background: #213547;
    border-color: #67c1f5;
}

.steam-game-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    background: #2a475e;
}

.steam-game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.steam-game-info {
    flex: 1;
    min-width: 0;
}

.steam-game-name {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.steam-game-playtime {
    font-size: 12px;
    color: #8f98a0;
    margin-bottom: 8px;
}

/* ========================================
   Achievements Styles
======================================== */

.show-achievements {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.show-achievements:hover {
    background: #0056b3;
}

.show-achievements:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.achievement-info {
    display: block;
    margin-top: 8px;
}

.achievement-progress {
    font-size: 12px;
    color: #c7d5e0;
}

.achievement-progress span {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.achievement-bar {
    background: #2a475e;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-top: 4px;
}

.achievement-fill {
    background: linear-gradient(90deg, #2bcf74 0%, #46d39a 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 2px; /* Минимальная ширина для видимости */
}

.achievement-error {
    color: #ff6b6b;
    font-size: 12px;
    font-style: italic;
}

/* ========================================
   Friends List
======================================== */

.steam-friends-list {
    display: grid;
    gap: 12px;
}

.steam-friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #1b2838;
    border-radius: 6px;
    border: 1px solid #2a475e;
    transition: all 0.2s ease;
}

.steam-friend-item:hover {
    background: #213547;
    border-color: #67c1f5;
}

.steam-friend-avatar {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #2a475e;
}

.steam-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.steam-friend-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #16202d;
    background: #8f98a0;
}

.steam-friend-online .steam-friend-status {
    background: #90ee90;
}

.steam-friend-info {
    flex: 1;
    min-width: 0;
}

.steam-friend-name {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.steam-friend-state {
    font-size: 12px;
    color: #8f98a0;
}

.steam-friend-online .steam-friend-state {
    color: #90ee90;
}

/* ========================================
   Inventory Buttons
======================================== */

.steam-inventory-buttons {
    display: grid;
    gap: 12px;
}

.steam-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    word-wrap: break-word;
}

.steam-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.steam-btn-primary {
    background: #67c1f5;
    color: #ffffff;
}

.steam-btn-primary:hover:not(:disabled) {
    background: #4a9eff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(103, 193, 245, 0.3);
}

.steam-btn-success {
    background: #4caf50;
    color: #ffffff;
}

.steam-btn-error {
    background: #f44336;
    color: #ffffff;
}

.steam-inventory-check-btn {
    position: relative;
    overflow: hidden;
}

/* ========================================
   No Data State
======================================== */

.steam-no-data {
    text-align: center;
    padding: 32px 16px;
    color: #8f98a0;
    font-style: italic;
    margin: 0;
    background: #1b2838;
    border-radius: 6px;
    border: 1px solid #2a475e;
}

/* ========================================
   Responsive Design
======================================== */

@media (max-width: 768px) {
    .steam-additional-modules {
        margin-top: 16px;
        gap: 12px;
    }
    
    .steam-extended-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px;
    }
    
    .steam-module-btn {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .steam-module-header {
        padding: 12px 16px;
    }
    
    .steam-module-title {
        font-size: 16px;
    }
    
    .steam-module-content {
        padding: 16px;
    }
    
    .steam-games-stats,
    .steam-friends-stats,
    .steam-inventory-status {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .steam-stat-item,
    .steam-status-item {
        padding: 12px;
    }
    
    .steam-stat-value,
    .steam-status-value {
        font-size: 20px;
    }
    
    .steam-game-item,
    .steam-friend-item {
        padding: 10px;
    }
    
    .steam-inventory-buttons {
        gap: 10px;
    }
    
    .steam-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .steam-module-error-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .steam-extended-buttons {
        padding: 12px;
    }
    
    .steam-module-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 40px;
    }
    
    .steam-module-header {
        padding: 10px 12px;
    }
    
    .steam-module-content {
        padding: 12px;
    }
    
    .steam-game-icon,
    .steam-friend-avatar {
        width: 28px;
        height: 28px;
    }
    
    .steam-friend-avatar {
        width: 36px;
        height: 36px;
    }
    
    .steam-game-name,
    .steam-friend-name {
        font-size: 13px;
    }
    
    .steam-game-playtime,
    .steam-friend-state {
        font-size: 11px;
    }
}

/* ========================================
   Dark Theme Compatibility
======================================== */

.steam-additional-modules *,
.steam-extended-info * {
    box-sizing: border-box;
}

/* Smooth animations for better UX */
.steam-module-content {
    overflow: hidden;
}

.steam-extended-buttons {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
.steam-module-toggle:focus,
.steam-retry-btn:focus,
.steam-btn:focus,
.steam-module-btn:focus {
    outline: 2px solid #67c1f5;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .steam-additional-modules,
    .steam-extended-info {
        background: white !important;
        color: black !important;
    }
    
    .steam-module,
    .steam-extended-info {
        border: 1px solid #ccc !important;
        background: white !important;
        break-inside: avoid;
    }
    
    .steam-module-header,
    .steam-extended-header {
        background: #f5f5f5 !important;
        color: black !important;
    }
    
    .steam-module-content {
        background: white !important;
        color: black !important;
    }
    
    .steam-module-toggle,
    .steam-retry-btn,
    .steam-btn,
    .steam-module-btn {
        display: none !important;
    }
}
