/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Loading state hidden class */
.app-loading-hidden {
    display: none !important;
}

/* Navigation active state */
nav a.active {
    text-decoration: underline;
    font-weight: bold;
}

/* Settings sections */
.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

section {
    margin-bottom: 3rem;
}

section h3 {
    margin-bottom: 0;
}

/* Equipment and Gig Type items */
.equipment-item,
.gigtype-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.equipment-item>div,
.gigtype-item>div {
    flex: 1;
}

.equipment-item strong,
.gigtype-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.equipment-item p,
.gigtype-item p {
    margin: 0;
}

.text-muted {
    opacity: 0.7;
}

/* Button groups */
.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Equipment selector in dialog */
.equipment-selector {
    background: var(--pico-form-element-background-color) !important;
    border: 1px solid var(--pico-form-element-border-color) !important;
    color: var(--pico-color) !important;
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    max-height: none !important;
    height: auto !important;
    overflow-y: visible !important;
}

.equipment-selector label {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.equipment-quantity-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--pico-border-radius);
    background: transparent !important;
    border: none !important;
}

.equipment-quantity-row:hover {
    background: var(--pico-form-element-hover-background-color);
}

/* Empty state */
.empty-state {
    text-align: center;
    opacity: 0.6;
    font-style: italic;
    padding: 2rem;
}

/* Gig items */
.gig-item {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.gig-item:hover {
    box-shadow: var(--pico-card-box-shadow);
}

.gig-item.past-gig {
    opacity: 0.6;
}

.gig-item.past-gig strong::after {
    content: " (Past)";
    font-size: 0.85em;
    color: var(--pico-muted-color);
    font-weight: normal;
}

.progress {
    display: block;
    margin-top: 0.5rem;
}

/* Tab buttons for gig detail */
.tab-buttons {
    margin-bottom: 1.5rem;
}

/* Checklist Progress */
.checklist-progress {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--pico-form-element-background-color);
    border: 1px solid var(--pico-form-element-border-color);
    border-radius: var(--pico-border-radius);
}

.progress-text {
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.progress-bar {
    height: 8px;
    background: var(--pico-form-element-border-color) !important;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--pico-form-element-valid-border-color, #10b981) !important;
    transition: width 0.3s ease;
}

/* Checklist Sections */
.checklist-section-missing {
    margin-bottom: 1.5rem;
}

.checklist-section-loaded {
    margin-bottom: 1.5rem;
}

.section-heading-missing {
    background: var(--pico-form-element-background-color);
    color: var(--pico-color);
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    border-left: 4px solid var(--pico-form-element-invalid-border-color, #ef4444);
    border: 1px solid var(--pico-form-element-border-color);
    border-left: 4px solid var(--pico-form-element-invalid-border-color, #ef4444);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.section-heading-loaded {
    color: var(--pico-form-element-valid-border-color, #10b981) !important;
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    background: var(--pico-form-element-background-color) !important;
    border: 1px solid var(--pico-form-element-border-color);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-heading-loaded:hover {
    background: var(--pico-form-element-hover-background-color);
}

/* Checklist */
.checklist {
    margin-bottom: 1.5rem;
}

.checklist h5 {
    margin-bottom: 1rem;
    color: var(--pico-h5-color);
}

/* Missing items - prominent */
.checklist-item-missing {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--pico-form-element-background-color) !important;
    border: 2px solid var(--pico-form-element-invalid-border-color, #ef4444) !important;
    border-radius: var(--pico-border-radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--pico-color) !important;
}

.checklist-item-missing:hover {
    background: var(--pico-form-element-hover-background-color);
    border-color: var(--pico-form-element-invalid-border-color, #ef4444);
    transform: translateX(4px);
}

.checklist-item-missing .item-icon {
    font-size: 1.5rem;
    opacity: 0.7;
}

.checklist-item-missing .item-content {
    flex: 1;
}

.checklist-item-missing .item-name {
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    color: var(--pico-color) !important;
}

.checklist-item-missing .item-action {
    font-size: 0.85rem;
    color: var(--pico-muted-color) !important;
    font-style: italic;
}

/* Loaded items - de-emphasized */
.checklist-item-loaded {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    opacity: 0.6;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: var(--pico-border-radius);
    background: var(--pico-form-element-background-color) !important;
    color: var(--pico-muted-color) !important;
}

.checklist-item-loaded:hover {
    opacity: 0.8;
    background: var(--pico-form-element-hover-background-color);
}

.checklist-item-loaded .item-icon {
    color: var(--pico-form-element-valid-border-color, #10b981);
    font-size: 1.2rem;
}

.checklist-item-loaded .item-name {
    font-size: 0.95rem;
}

/* All loaded message */
.all-loaded-message {
    background: var(--pico-form-element-background-color);
    border: 2px solid var(--pico-form-element-valid-border-color, #10b981);
    border-radius: var(--pico-border-radius);
    margin-bottom: 1.5rem;
}

.all-loaded-message h5 {
    color: var(--pico-form-element-valid-border-color, #10b981);
    margin-top: 0.5rem;
}

/* Old checklist styles (for backward compat) */
.checklist-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--pico-form-element-border-color);
    border-radius: var(--pico-border-radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.checklist-item:hover {
    background: var(--pico-form-element-hover-background-color);
}

.checklist-item input[type="checkbox"] {
    margin-right: 1rem;
    cursor: pointer;
}

.checklist-item input[type="checkbox"]:checked+span {
    text-decoration: line-through;
    opacity: 0.6;
}

/* Secondary checklist for items not brought */
.checklist-secondary {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--pico-form-element-border-color);
}

.checklist-secondary details {
    margin-bottom: 1rem;
}

.checklist-secondary summary {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 1rem;
}

.warning-text {
    background: var(--pico-warning-background-color, #fff3cd);
    color: var(--pico-warning-color, #856404);
    padding: 0.75rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.checklist-item.secondary {
    opacity: 0.8;
    border-style: dashed;
}

/* Spacing adjustments */
hgroup {
    margin-bottom: 1.5rem;
}

hgroup p {
    margin-top: 0;
}

/* Add item section */
.add-item-section {
    margin: 1.5rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--pico-form-element-border-color);
}

/* Inline modals (within dialog) */
.inline-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1 !important;
}

.inline-modal-content {
    background: var(--pico-card-background-color);
    padding: 2rem;
    border: 1px solid var(--pico-form-element-border-color);
    border-radius: var(--pico-border-radius);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--pico-card-box-shadow);
}

.inline-modal-content h5 {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Dialog header with native app back button */
dialog article header {
    background: var(--pico-card-background-color);
    border-bottom: 1px solid var(--pico-form-element-border-color);
    padding: var(--pico-spacing);
    margin: 0;
    flex-shrink: 0;
}

dialog article header a {
    color: var(--pico-form-element-valid-border-color, #10b981);
    cursor: pointer;
    padding: 0.5rem;
    margin: -0.5rem;
    display: inline-flex;
    align-items: center;
}

dialog article header a:hover {
    opacity: 0.8;
}

/* Dialog footer buttons */
dialog article footer {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--pico-card-background-color);
    border-top: 1px solid var(--pico-form-element-border-color);
    padding: var(--pico-spacing);
    margin: 0;
}

dialog article footer button {
    min-width: 100px;
}

/* Dialog/modal solid background fix - Full-screen overlay style */
dialog {
    max-width: 100%;
    max-height: 100%;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: var(--pico-background-color) !important;
    opacity: 1 !important;
    z-index: 1100;
}

dialog::backdrop {
    background: transparent !important;
    opacity: 0 !important;
}

dialog article {
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    background: var(--pico-background-color);
}

/* Overlay full-screen panel for ToGig/FromGig */
.overlay-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--pico-background-color);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 32px 0 rgba(0, 0, 0, 0.5);
    animation: overlayFadeIn 0.2s;
}

/* Sticky footer for overlay actions */
.sticky-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--pico-card-background-color);
    border-top: 1px solid var(--pico-form-element-border-color);
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Ensure overlay-content leaves space for sticky footer */
.overlay-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    padding-bottom: 6rem;
}

/* Fix overlay-screen visibility for gigs/settings */

/* Only show overlays when currentView === 'gigs' (handled in HTML) */

/* Fix main container visibility */
main.container {
    display: block;
}

/* Fix for invisible content: ensure overlays do not hide main content when not active */
[hidden],
[x-cloak] {
    display: none !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {

    .equipment-item,
    .gigtype-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .gig-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .button-group {
        width: 100%;
    }

    .button-group button {
        flex: 1;
    }

    /* Dialogs already full-screen, just ensure proper layout */
    dialog article header {
        flex-shrink: 0;
    }

    dialog article>div:not(header):not(footer) {
        flex: 1;
        overflow-y: auto;
    }

    dialog article footer {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background: var(--pico-background-color);
        border-top: 1px solid var(--pico-form-element-border-color);
    }

    /* Equipment selector full height */
    .equipment-selector {
        max-height: none !important;
        height: auto !important;
        overflow-y: visible !important;
    }

    /* Checklist full height */
    .checklist {
        flex: 1;
        overflow-y: auto;
        margin-bottom: 0;
    }
}

/* PWA-specific: Touch-friendly sizing */
@media (hover: none) and (pointer: coarse) {
    .checklist-item {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .checklist-item input[type="checkbox"] {
        width: 1.5rem;
        height: 1.5rem;
    }

    button {
        min-height: 44px;
    }
}

/* Pico CSS already handles dark theme - no overrides needed */