/* HeroCast Character UI */

/* Header Menu */
.herocast-header-menu {
    position: relative;
    /* top: 20px; */
    /* right: 20px; */
    display: flex;
    gap: 20px;
    z-index: 1000;
    margin-left: auto;
    margin-right: 0;
}

.herocast-menu-item {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 10px 20px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
}

.herocast-menu-item:hover {
    background: rgba(0, 0, 0, 0.9);
}

.herocast-menu-item:hover .herocast-dropdown {
    display: block;
}

.herocast-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
    overflow: hidden;
    z-index: 999;
}

.herocast-dropdown-item {
    padding: 12px 20px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.herocast-dropdown-item:hover {
    background: #f5f5f5;
}

/* Modals */
.herocast-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.herocast-modal.active {
    display: flex;
}

.herocast-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: #000;
}

.herocast-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.herocast-modal-close:hover {
    color: #333;
}

.herocast-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

/* Characters Grid */
.herocast-characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.herocast-character-card {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.herocast-character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.herocast-character-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #ddd;
}

.herocast-character-info {
    padding: 15px;
}

.herocast-character-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.herocast-character-date {
    font-size: 12px;
    color: #666;
}

.herocast-character-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.herocast-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.herocast-btn-primary {
    background: #4CAF50;
    color: white;
}

.herocast-btn-primary:hover {
    background: #45a049;
}

.herocast-btn-secondary {
    background: #999;
    color: white;
}

.herocast-btn-secondary:hover {
    background: #888;
}

.herocast-btn-danger {
    background: #f44336;
    color: white;
}

.herocast-btn-danger:hover {
    background: #da190b;
}

/* Form Elements */
.herocast-form-group {
    margin-bottom: 20px;
}

.herocast-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.herocast-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.herocast-form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.herocast-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Login Form */
.herocast-login-form {
    max-width: 400px;
    margin: 0 auto;
}

.herocast-login-form .herocast-form-group {
    margin-bottom: 20px;
}

.herocast-error {
    color: #f44336;
    margin-bottom: 15px;
    padding: 10px;
    background: #ffebee;
    border-radius: 4px;
}

.herocast-success {
    color: #4CAF50;
    margin-bottom: 15px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
}


/* Отображение текущего героя */
.current-hero-display {
    /* position: absolute; */
    top: 60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 999;
    line-height: 2;
}

.current-hero-display.saved {
    border-left: 3px solid #4CAF50;
}

.current-hero-display.unsaved {
    border-left: 3px solid #ff9800;
}
@media (max-width: 768px) { 

.current-hero-display {
    position: fixed;
    left: auto;
    right: 24px;
    top: 70px;
}
.herocast-header-menu {
    /* display: block; */
}
}

/* 📱 Мобильная версия - скрываем текст меню */
@media (max-width: 768px) {
    .herocast-menu-text {
        display: none;
    }
    
    .herocast-menu-icon {
        margin-right: 0;
        font-size: 1.2em;
    }
    
    .herocast-menu-item {
        padding: 8px 12px;
    }
}

/* 🖥️ Десктоп - показываем всё */
@media (min-width: 769px) {
    .herocast-menu-icon {
        margin-right: 6px;
    }
    
    .herocast-menu-text {
        display: inline;
    }
}



/* 📌 Стили для профиля */
#profile-modal .herocast-form-group {
    margin-bottom: 20px;
}

#profile-modal .herocast-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

#profile-modal .herocast-form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

#profile-modal .herocast-form-group input[readonly] {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* 📌 Стили для заказов */
.herocast-orders-list {
    max-height: 400px;
    overflow-y: auto;
}

.herocast-order-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
}

.herocast-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.herocast-order-number {
    font-weight: 600;
    color: #333;
}

.herocast-order-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.herocast-order-status.status-completed {
    background: #d4edda;
    color: #155724;
}

.herocast-order-status.status-processing {
    background: #fff3cd;
    color: #856404;
}

.herocast-order-status.status-pending {
    background: #f8d7da;
    color: #721c24;
}

.herocast-order-date {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.herocast-order-total {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.herocast-order-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

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

/* 📌 Вкладки авторизации */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.auth-tab.active {
    color: #ab3cd8;
    border-bottom: 2px solid #ab3cd8;
    margin-bottom: -2px;
}

.auth-tab:hover {
    color: #ab3cd8;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

.auth-success {
    color: #388e3c;
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

/* 📌 Стили для неактивного поля имени пользователя */
#profile-username[disabled] {
    background: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    border-color: #ddd !important;
}

#profile-username[disabled]:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 📦 Стили для заказов */
.herocast-orders-list {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

.herocast-order-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.herocast-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.herocast-order-number {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.herocast-order-status {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.herocast-order-status.status-completed {
    background: #d4edda;
    color: #155724;
}

.herocast-order-status.status-processing {
    background: #fff3cd;
    color: #856404;
}

.herocast-order-status.status-pending {
    background: #f8d7da;
    color: #721c24;
}

.herocast-order-status.status-producer,
.herocast-order-status.status-painting {
    background: #d1ecf1;
    color: #0c5460;
}

.herocast-order-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.herocast-order-total {
    font-weight: 600;
    font-size: 18px;
    color: #ab3cd8;
    margin-bottom: 15px;
}

.herocast-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.herocast-download-btn {
    background: #ab3cd8;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: background 0.3s;
}

.herocast-download-btn:hover {
    background: #8b5cf6;
}

.herocast-order-shipping {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
}

/* 📦 Стили для кнопки покупки */
.herocast-btn-success {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.herocast-btn-success:hover {
    background: #218838;
}

.herocast-purchase-section {
    text-align: center;
}