/**
 * /assets/css/gm-rest.css
 *
 * Purpose:  GM Lange Rast System – Provision-Bar, Hero-Cards, Watch-Cards, Heal-Summary
 *           Glassmorphism Design System
 * Deps:     app.css (variables: --accent, --danger, --gold, --exp), gm.css, gm-events.css
 * Load:     index.php
 * Version:  1.0.0
 */

/* ============================================================================
 * Provision Bar
 * ============================================================================ */

.gm-rest-provision-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    backdrop-filter: blur(6px);
}

.gm-rest-provision--ok {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.25);
}

.gm-rest-provision--low {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.25);
}

.gm-rest-provision-icon {
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.gm-rest-provision--ok .gm-rest-provision-icon {
    color: #28a745;
    background: rgba(40, 167, 69, 0.15);
}

.gm-rest-provision--low .gm-rest-provision-icon {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

.gm-rest-provision-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.gm-rest-provision-detail {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================================================
 * Hero Cards (Pre-Action Phase)
 * ============================================================================ */

.gm-rest-hero-card {
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    backdrop-filter: blur(6px);
}

.gm-rest-hero-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.gm-rest-hero-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.gm-rest-hero-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

.gm-rest-hero-name {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

/* ============================================================================
 * Action Selection Grid
 * ============================================================================ */

.gm-rest-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
}

.gm-rest-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 6px;
    border: 1px solid color-mix(in srgb, var(--action-color, #8b949e) 25%, transparent);
    background: color-mix(in srgb, var(--action-color, #8b949e) 8%, transparent);
    border-radius: 10px;
    color: var(--action-color, #8b949e);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
}

.gm-rest-action-btn:hover {
    background: color-mix(in srgb, var(--action-color, #8b949e) 18%, transparent);
    border-color: color-mix(in srgb, var(--action-color, #8b949e) 45%, transparent);
    transform: translateY(-2px);
}

.gm-rest-action-btn i {
    font-size: 1.1rem;
}

/* ============================================================================
 * Action Badge (assigned action)
 * ============================================================================ */

.gm-rest-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--action-color, #8b949e) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--action-color, #8b949e) 30%, transparent);
    color: var(--action-color, #8b949e);
}

/* ============================================================================
 * Resolve Row
 * ============================================================================ */

.gm-rest-resolve-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

.gm-rest-resolve-row .form-control {
    flex: 1;
}

.gm-rest-result-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(93, 214, 201, 0.06);
    border-radius: 6px;
    border-left: 2px solid rgba(93, 214, 201, 0.3);
}

/* ============================================================================
 * Big Icon (for action/event detail views)
 * ============================================================================ */

.gm-rest-big-icon {
    font-size: 2.5rem;
    display: inline-block;
}

/* ============================================================================
 * Watch Cards (Watch Phase)
 * ============================================================================ */

.gm-rest-watch-card {
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    backdrop-filter: blur(6px);
}

.gm-rest-watch-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: color-mix(in srgb, var(--watch-color, #4da3ff) 6%, transparent);
    border-left: 3px solid var(--watch-color, #4da3ff);
}

.gm-rest-watch-header i {
    color: var(--watch-color, #4da3ff);
    font-size: 1.1rem;
}

.gm-rest-watch-label {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

.gm-rest-watch-assignee {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 999px;
}

.gm-rest-watch-assign {
    padding: 12px 14px;
}

/* ============================================================================
 * Assign Buttons (hero selection for watches)
 * ============================================================================ */

.gm-rest-assign-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 500;
}

.gm-rest-assign-btn:hover:not([disabled]) {
    background: rgba(77, 163, 255, 0.12);
    border-color: rgba(77, 163, 255, 0.3);
    transform: translateY(-2px);
}

.gm-rest-assign-btn--used {
    opacity: 0.35;
    cursor: not-allowed;
}

.gm-rest-assign-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* ============================================================================
 * Watch Events
 * ============================================================================ */

.gm-rest-watch-events {
    padding: 8px 14px;
}

.gm-rest-watch-event {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    border-left: 3px solid var(--we-color, #8b949e);
}

.gm-rest-watch-event > i:first-child {
    color: var(--we-color, #8b949e);
    font-size: 1rem;
    margin-top: 2px;
}

.gm-rest-watch-event-content {
    flex: 1;
    font-size: 0.85rem;
    min-width: 0;
}

.gm-rest-we-result {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 3px;
}

.gm-rest-we-resolve {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.gm-rest-we-resolve .form-control {
    width: 140px;
    font-size: 0.75rem;
}

/* ============================================================================
 * Watch Action Buttons
 * ============================================================================ */

.gm-rest-watch-actions {
    padding: 8px 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.gm-rest-we-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--we-color, #8b949e) 25%, transparent);
    background: color-mix(in srgb, var(--we-color, #8b949e) 6%, transparent);
    border-radius: 8px;
    color: var(--we-color, #8b949e);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.gm-rest-we-add-btn:hover {
    background: color-mix(in srgb, var(--we-color, #8b949e) 15%, transparent);
    border-color: color-mix(in srgb, var(--we-color, #8b949e) 40%, transparent);
    transform: translateY(-1px);
}

.gm-rest-we-add-btn i {
    font-size: 0.75rem;
}

/* ============================================================================
 * Heal Summary (Completed Phase)
 * ============================================================================ */

.gm-rest-heal-summary,
.gm-rest-watch-summary {
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(6px);
}

.gm-rest-heal-header {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gm-rest-heal-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.8rem;
}

.gm-rest-heal-name {
    font-weight: 600;
    min-width: 80px;
}

.gm-rest-heal-hp,
.gm-rest-heal-mana {
    font-size: 0.75rem;
}

.gm-rest-watch-summary-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.8rem;
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .gm-rest-action-btn,
    .gm-rest-assign-btn,
    .gm-rest-we-add-btn {
        transition: none;
    }
    .gm-rest-action-btn:hover,
    .gm-rest-assign-btn:hover,
    .gm-rest-we-add-btn:hover {
        transform: none;
    }
}

/* ============================================================================
 * Mobile
 * ============================================================================ */

@media (max-width: 576px) {
    .gm-rest-action-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .gm-rest-we-resolve .form-control {
        width: 100px;
    }

    .gm-rest-heal-row {
        flex-wrap: wrap;
    }
}
