/**
 * Owned Items Modal Styles
 */

/* Modal header */
#ownedItemsModal .modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

/* Title display */
#ownedTitleDisplay {
    color: #198754;
}

/* Accordion styling */
#ownedItemsAccordion .accordion-button {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

#ownedItemsAccordion .accordion-button:not(.collapsed) {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

#ownedItemsAccordion .accordion-button:focus {
    box-shadow: none;
    border-color: rgba(25, 135, 84, 0.25);
}

#ownedItemsAccordion .accordion-body {
    padding: 1rem;
    background-color: #f8f9fa;
    font-size: 0.9rem;
}

#ownedItemsAccordion .accordion-body .row {
    margin-bottom: 0.25rem;
}

/* Form styling */
#ownedItemForm .form-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

#ownedItemForm .form-control,
#ownedItemForm .form-select {
    font-size: 0.95rem;
}

#ownedItemForm .form-text {
    font-size: 0.8rem;
}

#ownedItemForm .form-check-label {
    font-size: 0.9rem;
}

/* Empty state */
#ownedEmptyState {
    color: #6c757d;
}

#ownedEmptyState .bi-disc {
    opacity: 0.5;
}

/* Loading state */
#ownedLoadingState {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Add another button */
#addAnotherOwnedBtn {
    border-style: dashed;
}

#addAnotherOwnedBtn:hover {
    border-style: solid;
}

/* Release Cards */
.release-card {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--mv-border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.release-card:hover {
    border-color: #198754;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.15);
}

.release-card.owned-indicator {
    border-left: 4px solid #198754;
    background-color: rgba(25, 135, 84, 0.05);
}

.release-card-cover {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    background: #e9ecef;
    flex-shrink: 0;
}

.release-card-cover-placeholder {
    width: 50px;
    height: 75px;
    background: linear-gradient(135deg, #e9ecef 0%, var(--mv-border-color) 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.release-card-cover-placeholder i {
    font-size: 1.5rem;
    color: #adb5bd;
}

.release-card-info {
    flex: 1;
    padding: 0 0.75rem;
    min-width: 0;
}

.release-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #212529;
}

.release-card-specs {
    font-size: 0.8rem;
    color: #6c757d;
}

.release-card-specs span {
    display: inline-block;
    margin-right: 0.75rem;
}

.release-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}

.release-card-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Other Format Card */
.release-card-other {
    border-style: dashed;
    background: #f8f9fa;
}

.release-card-other:hover {
    border-style: solid;
    background: #fff;
}

.release-card-other-icon {
    width: 50px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 4px;
    flex-shrink: 0;
}

.release-card-other-icon i {
    font-size: 1.5rem;
    color: #198754;
}

/* Item Details Popup */
.item-details-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.item-details-content {
    background: #fff;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.item-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--mv-border-color);
    background: #198754;
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

.item-details-header h5 {
    margin: 0;
    font-size: 1rem;
}

.item-details-header .btn-close {
    filter: brightness(0) invert(1);
}

.item-details-body {
    padding: 1rem;
}

.item-details-top {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.item-details-cover {
    width: 120px;
    flex-shrink: 0;
}

.item-details-cover img {
    width: 100%;
    border-radius: 4px;
}

.item-details-main {
    flex: 1;
}

.item-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.item-details-section h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #198754;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.25rem;
}

.item-details-section p {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #495057;
}

.item-details-section p strong {
    color: #212529;
}

.item-details-footer {
    padding: 1rem;
    border-top: 1px solid var(--mv-border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Available releases section header */
.releases-section-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    #ownedItemsModal .modal-dialog {
        margin: 0.5rem;
    }

    #ownedItemsAccordion .accordion-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    #ownedItemsAccordion .accordion-button .badge {
        display: none;
    }

    #ownedItemForm .row > div {
        margin-bottom: 0.75rem;
    }

    /* Release card responsive */
    .release-card {
        flex-wrap: wrap;
    }

    .release-card-info {
        flex-basis: calc(100% - 60px);
        padding: 0 0 0 0.75rem;
    }

    .release-card-actions {
        flex-basis: 100%;
        flex-direction: row;
        margin-top: 0.5rem;
        padding-left: 60px;
    }

    .item-details-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .item-details-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   DARK MODE OVERRIDES
   ======================================== */

/* Accordion body */
[data-bs-theme="dark"] #ownedItemsAccordion .accordion-body {
    background-color: var(--mv-bg-surface);
}
[data-bs-theme="dark"] #ownedItemsAccordion .accordion-button:not(.collapsed) {
    background-color: rgba(25, 135, 84, 0.15);
}

/* Empty state */
[data-bs-theme="dark"] #ownedEmptyState {
    color: var(--mv-text-muted);
}

/* Release cards */
[data-bs-theme="dark"] .release-card {
    border-color: var(--mv-border-color);
    background: var(--mv-bg-card);
}
[data-bs-theme="dark"] .release-card:hover {
    border-color: #198754;
}
[data-bs-theme="dark"] .release-card-cover {
    background: var(--mv-bg-hover);
}
[data-bs-theme="dark"] .release-card-cover-placeholder {
    background: var(--mv-bg-hover);
}
[data-bs-theme="dark"] .release-card-cover-placeholder i {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .release-card-title {
    color: var(--mv-text-primary);
}
[data-bs-theme="dark"] .release-card-specs {
    color: var(--mv-text-muted);
}

/* Other Format card */
[data-bs-theme="dark"] .release-card-other {
    background: var(--mv-bg-surface);
}
[data-bs-theme="dark"] .release-card-other:hover {
    background: var(--mv-bg-card);
}
[data-bs-theme="dark"] .release-card-other-icon {
    background: var(--mv-bg-hover);
}

/* Item details popup */
[data-bs-theme="dark"] .item-details-content {
    background: var(--mv-bg-modal);
}
[data-bs-theme="dark"] .item-details-section h6 {
    border-bottom-color: var(--mv-border-color);
}
[data-bs-theme="dark"] .item-details-section p {
    color: var(--mv-text-secondary);
}
[data-bs-theme="dark"] .item-details-section p strong {
    color: var(--mv-text-primary);
}
[data-bs-theme="dark"] .item-details-footer {
    border-top-color: var(--mv-border-color);
}

/* Releases section header */
[data-bs-theme="dark"] .releases-section-header {
    color: var(--mv-text-secondary);
    border-bottom-color: var(--mv-border-color);
}
