/* Основные стили */
.maxma-block {
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    background: #fff;
}
.maxma-form {
    display: grid;
    gap: 10px;
    margin: 10px 0;
}
.maxma-form label {
    display: grid;
    gap: 6px;
}
.maxma-form input {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
.maxma-form button {
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    cursor: pointer;
}
.maxma-result {
    white-space: pre-wrap;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    padding: 10px;
    border-radius: 6px;
}
.maxma-points {
    font-weight: 600;
}

/* Заголовки для новых форм */
.maxma-block h3 {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
}

/* Стили для разных типов форм */
.maxma-block.maxma-calculate-purchase {
    border-left: 4px solid #3b82f6;
}
.maxma-block.maxma-confirm-order {
    border-left: 4px solid #10b981;
}
.maxma-block.maxma-cancel-order {
    border-left: 4px solid #f59e0b;
}
.maxma-block.maxma-apply-return {
    border-left: 4px solid #ef4444;
}

.maxma-block.maxma-client-history {
    border-left: 4px solid #8b5cf6;
}
.maxma-block.maxma-update-client {
    border-left: 4px solid #06b6d4;
}
.maxma-block.maxma-adjust-balance {
    border-left: 4px solid #f97316;
}
.maxma-block.maxma-issue-promocode {
    border-left: 4px solid #84cc16;
}
.maxma-block.maxma-delete-client {
    border-left: 4px solid #dc2626;
}

.maxma-block.maxma-activate-gift-card {
    border-left: 4px solid #ec4899;
}
.maxma-block.maxma-discard-gift-card {
    border-left: 4px solid #6b7280;
}
.maxma-block.maxma-generate-gift-card {
    border-left: 4px solid #14b8a6;
}

/* Кнопка удаления */
.maxma-form .button-danger {
    background: #dc2626;
}
.maxma-form .button-danger:hover {
    background: #b91c1c;
}

/* Подсказки */
.maxma-form small {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

/* Кнопки в формах */
.maxma-form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.maxma-form-buttons button {
    flex: 1;
}

.maxma-back-btn {
    background: #6b7280 !important;
    color: white !important;
}

.maxma-back-btn:hover {
    background: #4b5563 !important;
}

/* ===== СТИЛИ ЛИЧНОГО КАБИНЕТА ===== */

/* Главный контейнер личного кабинета */
.maxma-client-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Стили для модальных окон */
.maxma-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.maxma-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.maxma-modal-large {
    max-width: 800px;
}

.maxma-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.maxma-modal-header h3 {
    margin: 0;
    color: #333;
}

.maxma-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.maxma-modal-body {
    padding: 20px;
}

.maxma-orders-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.maxma-orders-filters label {
    flex: 1;
    min-width: 150px;
}

.maxma-orders-filters button {
    align-self: flex-end;
    padding: 10px 20px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.maxma-orders-filters button:hover {
    background-color: #005a87;
}

.maxma-gift-cards-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.maxma-gift-cards-actions button {
    flex: 1;
    padding: 12px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    min-width: 150px;
}

.maxma-gift-cards-actions button:hover {
    background-color: #218838;
}

.maxma-order-amount {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* Стили для блока Recent Activity в основном кабинете */
.maxma-orders-preview .maxma-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 5px;
}

.maxma-orders-preview .maxma-order-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.maxma-orders-preview .maxma-order-id {
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
    margin-right: 10px;
}

.maxma-orders-preview .maxma-order-date {
    color: #666;
    font-size: 0.8em;
    margin-right: 10px;
}

.maxma-orders-preview .maxma-order-status {
    flex: 1;
    color: #555;
    font-size: 0.9em;
    margin-right: 10px;
    padding: 0;
}

.maxma-orders-preview .maxma-order-amount {
    font-weight: bold;
    color: #007cba;
    font-size: 0.9em;
    margin: 0;
}

/* Стили для истории заказов в модальном окне */
.maxma-order-detail {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fafafa;
}

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

.maxma-order-id {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.maxma-order-date {
    color: #666;
    font-size: 0.9em;
}

.maxma-order-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.maxma-order-description {
    margin: 0;
    color: #555;
    flex: 1;
}

.maxma-order-amount {
    margin: 0;
    font-weight: bold;
    color: #007cba;
    font-size: 1.1em;
}

/* Заголовок кабинета */
.maxma-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.maxma-dashboard-header h2 {
    margin: 0;
    color: #111827;
    font-size: 28px;
    font-weight: 700;
}

/* Статус авторизации */
.maxma-auth-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.maxma-status-text {
    color: #6b7280;
    font-weight: 500;
}

.maxma-logout-btn {
    padding: 8px 16px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.maxma-logout-btn:hover {
    background: #b91c1c;
}

/* Сетка информационных карточек */
.maxma-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.maxma-info-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.maxma-info-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.maxma-info-card h3 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 10px;
}

/* Данные профиля */
.maxma-profile-data {
    margin-bottom: 15px;
}

.maxma-profile-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
}

.maxma-profile-label {
    font-weight: 500;
    color: #6b7280;
}

.maxma-profile-value {
    color: #111827;
    font-weight: 600;
}

/* Отображение баллов */
.maxma-points-display {
    text-align: center;
    margin-bottom: 15px;
}

.maxma-points-amount {
    font-size: 32px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 5px;
}

.maxma-points-label {
    color: #6b7280;
    font-size: 14px;
}

/* Превью заказов */
.maxma-orders-preview {
    margin-bottom: 15px;
}

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

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

.maxma-order-id {
    font-weight: 600;
    color: #111827;
}

.maxma-order-date {
    color: #6b7280;
    font-size: 14px;
}

.maxma-order-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.maxma-order-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.maxma-order-status.processing {
    background: #fef3c7;
    color: #92400e;
}

/* Превью подарочных карт */
.maxma-gift-cards-preview {
    margin-bottom: 15px;
}

.maxma-gift-card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.maxma-gift-card-item:last-child {
    border-bottom: none;
}

.maxma-gift-card-code {
    font-family: monospace;
    font-weight: 600;
    color: #111827;
}

.maxma-gift-card-amount {
    color: #059669;
    font-weight: 600;
}

/* Кнопки действий */
.maxma-edit-profile-btn,
.maxma-redeem-btn,
.maxma-view-orders-btn,
.maxma-view-gift-cards-btn {
    width: 100%;
    padding: 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}

.maxma-edit-profile-btn:hover,
.maxma-redeem-btn:hover,
.maxma-view-orders-btn:hover,
.maxma-view-gift-cards-btn:hover {
    background: #2563eb;
}

/* Фильтры заказов */
.maxma-orders-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.maxma-load-history-btn {
    padding: 10px 20px;
    background: #059669;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    align-self: end;
}

.maxma-load-history-btn:hover {
    background: #047857;
}

/* Список заказов */
.maxma-orders-list {
    margin-top: 20px;
}

.maxma-order-detail {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

/* Табы для подарочных карт */
.maxma-gift-cards-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.maxma-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.maxma-tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.maxma-tab-btn:hover {
    color: #374151;
}

.maxma-tab-content {
    padding: 20px 0;
}

/* Стили для редактирования профиля */
.maxma-block.maxma-profile-edit {
    border-left: 4px solid #8b5cf6;
}

.maxma-block.maxma-client-orders {
    border-left: 4px solid #f59e0b;
}

.maxma-block.maxma-client-gift-cards {
    border-left: 4px solid #ec4899;
}

/* Адаптивность */
@media (max-width: 768px) {
    .maxma-block {
        padding: 12px;
        margin: 8px 0;
    }
    .maxma-form input {
        padding: 6px 8px;
    }
    .maxma-form button {
        padding: 6px 10px;
    }

    .maxma-client-dashboard {
        padding: 10px;
    }

    .maxma-dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .maxma-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .maxma-orders-filters {
        grid-template-columns: 1fr;
    }

    .maxma-gift-cards-tabs {
        flex-direction: column;
    }

    .maxma-tab-btn {
        text-align: left;
        border-bottom: 1px solid #e5e7eb;
        border-right: none;
    }

    .maxma-tab-btn.active {
        border-bottom-color: #e5e7eb;
        border-left: 3px solid #3b82f6;
    }
}

/* Стили для подарочных карт */
.maxma-gift-card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}

.maxma-gift-card-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.maxma-gift-card-code {
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
    margin-right: 10px;
}

.maxma-gift-card-amount {
    color: #007cba;
    font-weight: bold;
    font-size: 0.9em;
    margin-right: 10px;
}

.maxma-gift-card-status {
    color: #28a745;
    font-size: 0.8em;
    text-transform: uppercase;
    font-weight: bold;
}
