/* ==========================================
   List Page Specific Styles
   ========================================== */

/* Main container (for hybrid layout with header/footer) */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Credit Banner */
.credit-banner {
  background: linear-gradient(135deg, var(--mhw-brown) 0%, var(--mhw-brown-dark) 100%);
  border: 2px solid var(--mhw-orange);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.2);
}

.credit-info {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.credit-label {
  color: var(--mhw-text-muted);
  font-size: 1rem;
}

.credit-display {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.credit-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--mhw-orange);
  line-height: 1;
}

.credit-unit {
  color: var(--mhw-text);
  font-size: 1.2rem;
}

.btn-purchase-credit {
  background: var(--mhw-orange);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-purchase-credit:hover {
  background: var(--mhw-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.4);
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
  text-align: center;
}

.page-header h1 {
  color: var(--mhw-orange);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-description {
  color: var(--mhw-text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Controls section */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(61, 53, 48, 0.4);
    border-radius: 8px;
}

.controls__buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Quick action buttons animation */
.quick-action-btn {
    animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.controls__search {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.controls .btn {
    margin: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid var(--mhw-brown-light);
    border-top: 4px solid var(--mhw-orange);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Data count */
.data-count {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--mhw-text-muted);
}

/* Table container */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Talisman table */
.talisman-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(29, 26, 20, 0.6);
    font-size: 0.9rem;
}

.talisman-table thead {
    background: rgba(61, 53, 48, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.talisman-table th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--mhw-orange);
    white-space: nowrap;
    color: var(--mhw-gold);
}

.talisman-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.talisman-table th.sortable:hover {
    background-color: rgba(61, 53, 48, 0.9);
}

.talisman-table th.sortable .sort-icon {
    margin-left: 0.25rem;
    color: var(--mhw-text-muted);
    font-size: 0.8rem;
}

.talisman-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--mhw-brown-light);
    color: var(--mhw-text);
}

.talisman-table tbody tr {
    transition: background-color 0.2s;
}

.talisman-table tbody tr:hover {
    background-color: rgba(61, 53, 48, 0.6);
}

.talisman-table tbody tr.selected {
    background-color: rgba(212, 105, 42, 0.2);
}

/* Table columns */
.col-select {
    width: 40px;
    text-align: center;
}

.col-name {
    width: 5rem;
    max-width: 5rem;
    font-weight: 500;
}

.col-rare {
    width: 60px;
    text-align: center;
}

.col-skill {
    min-width: 120px;
}

.col-slots {
    min-width: 100px;
    white-space: nowrap;
}

.col-date {
    min-width: 140px;
}

/* Text utilities */
.text-center {
    text-align: center;
}

.text-small {
    font-size: 0.85rem;
}

.text-muted {
    color: var(--mhw-text-muted);
}

/* Row checkbox */
.row-select {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(61, 53, 48, 0.4);
    border-radius: 8px;
    margin: 2rem 0;
}

.empty-state__icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state__text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--mhw-text);
}

.empty-state__hint {
    color: var(--mhw-text-muted);
    margin-bottom: 1.5rem;
}

/* Success button variant */
.btn--success {
    background: linear-gradient(135deg, var(--color-success) 0%, #1e7e34 100%);
    color: var(--mhw-text);
    border: 2px solid var(--color-success);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.btn--success:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e7e34 0%, var(--color-success) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.6);
}

/* Info button variant */
.btn--info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: var(--mhw-text);
    border: 2px solid #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn--info:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.6);
}

.btn--info:disabled {
    background: #6c757d;
    border-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

.btn--secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    color: var(--mhw-text);
    border: 2px solid var(--color-secondary);
}

.btn--secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-secondary-dark) 0%, var(--color-secondary) 100%);
    transform: translateY(-2px);
}

.btn--small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Search input (legacy) */
.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--mhw-brown-light);
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 300px;
    flex: 1;
    background: rgba(29, 26, 20, 0.6);
    color: var(--mhw-text);
}

.search-input:focus {
    outline: none;
    border-color: var(--mhw-orange);
    box-shadow: 0 0 0 0.2rem rgba(212, 105, 42, 0.25);
}

/* Skill search section */
.controls__skill-search {
    background: rgba(29, 26, 20, 0.6);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--mhw-brown-light);
    margin-bottom: 1rem;
}

.skill-search-input-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.skill-search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--mhw-brown-light);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: rgba(29, 26, 20, 0.8);
    color: var(--mhw-text);
}

.skill-search-input:focus {
    outline: none;
    border-color: var(--mhw-orange);
    box-shadow: 0 0 0 0.2rem rgba(212, 105, 42, 0.25);
}

/* Skill suggestions dropdown */
.skill-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(29, 26, 20, 0.95);
    border: 1px solid var(--mhw-orange);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.skill-suggestion-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    color: var(--mhw-text);
}

.skill-suggestion-item:hover {
    background-color: rgba(212, 105, 42, 0.3);
}

.skill-suggestion-item:active {
    background-color: rgba(212, 105, 42, 0.5);
}

/* Selected skills (chips) */
.selected-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 32px;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--mhw-orange) 0%, var(--mhw-orange-dark) 100%);
    color: var(--mhw-text);
    border: 1px solid var(--mhw-gold);
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.skill-chip:hover {
    background: linear-gradient(135deg, var(--mhw-orange-dark) 0%, var(--mhw-orange) 100%);
}

.skill-chip__remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.skill-chip__remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* RARE filter section */
.controls__rare-filter {
    background: rgba(29, 26, 20, 0.6);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--mhw-brown-light);
    margin-bottom: 1rem;
}

.rare-filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Slot filter */
.controls__slot-filter {
    background: rgba(29, 26, 20, 0.6);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--mhw-brown-light);
}

.filter-label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--mhw-gold);
    font-size: 0.9rem;
}

.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.5rem;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.slot-filter-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--mhw-brown-light);
    border-radius: 4px;
    background: rgba(29, 26, 20, 0.8);
    color: var(--mhw-text);
    font-size: 0.85rem;
    min-width: 120px;
    cursor: pointer;
}

.slot-filter-select:focus {
    outline: none;
    border-color: var(--mhw-orange);
    box-shadow: 0 0 0 0.2rem rgba(212, 105, 42, 0.25);
}

.btn--success:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Controls footer */
.controls__footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .search-input {
        min-width: 200px;
    }

    .skill-search-input {
        font-size: 0.85rem;
    }

    .skill-suggestions {
        max-height: 200px;
    }

    .skill-chip {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .rare-filter-group {
        gap: 0.75rem;
    }

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

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-group label {
        width: 100%;
        justify-content: space-between;
    }

    .controls__buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .controls__buttons .btn {
        width: 100%;
        min-width: 0;
    }

    /* Quick action buttons span full width on mobile */
    .controls__buttons .quick-action-btn {
        grid-column: 1 / -1;
    }

    .nav-buttons {
        flex-direction: column;
        gap: var(--spacing-sm, 0.5rem);
    }

    .nav-buttons .btn {
        width: 100%;
    }

    .talisman-table {
        font-size: 0.85rem;
    }

    .talisman-table th,
    .talisman-table td {
        padding: 0.5rem 0.3rem;
    }

    /* チェックボックス列の最小幅 */
    .talisman-table th:first-child,
    .talisman-table td:first-child {
        min-width: 40px;
    }

    .col-skill {
        min-width: 100px;
    }

    .col-date {
        min-width: 120px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .talisman-table {
        font-size: 0.75rem;
    }

    .talisman-table th,
    .talisman-table td {
        padding: 0.4rem 0.2rem;
    }

    .col-skill {
        min-width: 80px;
    }

    .slot-icon {
        width: 0.9em;
        height: 0.9em;
    }
}

/* ==========================================
   Slot Icons
   ========================================== */
.slot-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    margin-right: 4px;
    /* PNGアイコンを綺麗に表示 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.slot-icon--weapon {
    /* 武器スロット用（必要に応じてフィルター適用可能） */
}

.slot-icon--armor {
    /* 防具スロット用（必要に応じてフィルター適用可能） */
}

/* モバイルでのスロットアイコンサイズ調整 */
@media (max-width: 768px) {
    .slot-icon {
        width: 1.3em;
        height: 1.3em;
        margin-right: 3px;
    }
}

/* ==========================================
   Actions Column
   ========================================== */
.col-actions {
    min-width: 100px;
    text-align: center;
}

/* Action buttons in table */
.action-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn--archive {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    color: var(--mhw-text);
    border: 1px solid var(--color-secondary);
}

.action-btn--archive:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-secondary-dark) 0%, var(--color-secondary) 100%);
}

.action-btn--unarchive {
    background: linear-gradient(135deg, var(--color-success) 0%, #1e7e34 100%);
    color: var(--mhw-text);
    border: 1px solid var(--color-success);
}

.action-btn--unarchive:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e7e34 0%, var(--color-success) 100%);
}

/* Archived row styling */
.talisman-table tbody tr.archived {
    background-color: rgba(61, 53, 48, 0.3);
    opacity: 0.7;
}

.talisman-table tbody tr.archived td {
    color: var(--mhw-text-muted);
}

.archived-date {
    font-size: 0.75rem;
    color: var(--mhw-text-muted);
    font-style: italic;
    margin-top: 0.25rem;
}

/* ==========================================
   Archive Confirmation Modal
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(29, 26, 20, 0.95);
    border: 2px solid var(--mhw-orange);
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(212, 105, 42, 0.3);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--mhw-gold);
}

.modal-content p {
    margin-bottom: 1.5rem;
    color: var(--mhw-text);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-buttons .btn {
    margin: 0;
}

/* Vertical button layout for download/copy modals */
.modal-buttons--vertical {
    flex-direction: column;
    align-items: stretch;
}

.modal-buttons--vertical .btn {
    width: 100%;
    justify-content: center;
}

/* Mobile responsiveness for actions and modal */
@media (max-width: 768px) {
    .col-actions {
        min-width: 80px;
    }

    .action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .modal-content {
        padding: 1.5rem;
    }
}
