/**
 * Lister - Shared Lists
 * "It's better than life."
 */

/* Header */
.lister-header {
    background: linear-gradient(180deg, #0a4f4f 0%, #062e2e 100%);
    border: 4px outset #1a8f8f;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.lister-header-view {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 3px outset #444;
    margin-bottom: 20px;
    align-items: stretch;
}

.lister-header-view .list-description {
    color: #cccccc;
}

.lister-header-view .list-meta {
    color: #888;
}

.lister-header img {
    height: 75px;
    width: auto;
}

.lister-header-text {
    flex: 1;
}

.lister-header h1 {
    color: #ffcc00;
    font-family: 'Arial Black', sans-serif;
    text-shadow: 3px 3px 0px #000;
    margin: 0 0 8px 0;
}

.lister-tagline {
    color: #7fdbdb;
    font-family: 'Courier New', monospace;
    font-style: italic;
    margin: 0;
}

.lister-header .list-description {
    color: #ffffff;
    margin: 10px 0;
}

.lister-header .list-meta {
    color: #cccccc;
    font-size: 14px;
}

.lister-header .list-meta a {
    color: #00ffff;
    text-decoration: underline;
}

.list-header-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 15px;
}

.list-header-text {
    flex: 1;
}

.list-header-image {
    flex-shrink: 0;
    order: -1;
    display: flex;
    align-items: stretch;
}

.list-header-image img {
    max-width: 200px;
    max-height: 150px;
    border: 2px solid #ffcc00;
}

.lister-header-view .list-header-image img {
    border: 3px solid #2f3553;
    max-width: 180px;
    max-height: none;
    height: 100%;
    width: auto;
}

.list-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* List Rows */
.lister-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.lister-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.list-row {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(17, 17, 31, 0.98) 0%, rgba(11, 11, 20, 0.98) 100%);
    border: 2px ridge #2f3553;
    box-shadow: 0 2px 0 #000;
}

.list-row:hover {
    border-color: #1a8f8f;
    background: linear-gradient(180deg, rgba(19, 23, 38, 0.98) 0%, rgba(10, 10, 18, 0.98) 100%);
}

.list-row-image-link {
    display: block;
    flex-shrink: 0;
    line-height: 0;
}

.list-row-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #ffcc00;
    flex-shrink: 0;
}

.list-row-content {
    flex: 1;
    min-width: 0;
}

.list-row-title {
    display: inline-block;
    color: #ffcc00;
    font-family: 'Arial Black', sans-serif;
    font-size: 16px;
    margin-bottom: 4px;
    text-decoration: none;
}

.list-row-title:hover {
    color: #ffffff;
    text-decoration: underline;
}

.list-row-description {
    color: #cccccc;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.list-row-meta {
    color: #888888;
    font-size: 13px;
}

/* List Table */
.lister-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.lister-table {
    width: 100%;
    border-collapse: collapse;
    background: #0b0b14;
    border: 3px solid #333;
}

.lister-table thead {
    background: linear-gradient(180deg, #8b0000 0%, #5a0000 100%);
}

.lister-table th {
    color: #ffcc00;
    font-family: 'Arial Black', sans-serif;
    text-align: left;
    padding: 12px;
    border: 2px solid #cc0000;
}

.sortable-header {
    color: #ffcc00;
    text-decoration: none;
    display: block;
}

.sortable-header:hover {
    color: #ffffff;
}

.lister-table td {
    padding: 10px 12px;
    border: 1px solid #333;
    color: #e0e0e0;
}

.lister-table tbody tr:nth-child(even) {
    background: #151526;
}

.lister-table tbody tr:hover {
    background: #1f1f33;
}

/* List Items (View) */
.lister-items {
    margin: 0;
    padding-left: 18px;
    color: #e0e0e0;
}

/* Actionable lists - no bullets */
.lister-items-actionable {
    list-style: none;
    padding-left: 0;
}

.lister-items-actionable .lister-item {
    padding-left: 12px;
}

/* List type badge */
.list-type-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    text-transform: uppercase;
    border-radius: 2px;
}

.list-type-badge.actionable {
    background: #2a4a2a;
    color: #7fdb7f;
    border: 1px solid #3a6a3a;
}

.lister-item {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #333;
}

.lister-item:last-child {
    margin-bottom: 0;
}

.item-check-label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.item-toggle {
    margin-left: auto;
    transform: scale(1.05);
}

.lister-item.checked .item-text {
    text-decoration: line-through;
    color: #888;
}

.null-value {
    color: #999;
    font-style: italic;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell .btn {
    margin-right: 5px;
}

/* Forms */
.lister-form-container {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 4px ridge #ffb066;
    padding: 30px;
    margin-bottom: 30px;
    max-width: 800px;
    box-shadow: 0 8px 0 #000, 0 12px 18px rgba(0, 0, 0, 0.45);
    color: #cccccc;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #ffcc00;
    font-family: 'Arial Black', sans-serif;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-size: 12px;
}

.form-group label.btn {
    display: inline-flex;
    margin-bottom: 0;
    color: var(--btn-text-color);
    font-family: var(--btn-font);
    text-transform: uppercase;
    font-size: 13px;
}

.required {
    color: #cc0000;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px;
    background: #000000;
    border: 2px inset #444;
    color: #00ff66;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    background: #1a1a2e;
    border: 2px solid #444;
    color: #ffcc00;
    font-family: 'Arial', sans-serif;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid #00ffff;
    border-color: #00ffff;
}

.checkbox-label {
    font-family: 'Arial', sans-serif !important;
    text-transform: none !important;
    font-weight: normal !important;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cccccc;
    font-size: 16px !important;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    transform: scale(1.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.form-row-inline {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: nowrap;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 15px;
}

.form-row-inline .form-group {
    margin-bottom: 0;
}

.form-row-inline .form-group:first-child {
    flex: 1;
    min-width: 320px;
}

.form-row-inline .form-group:last-child {
    margin-left: auto;
}

/* 50/50 layout for list type + visibility */
.form-row-50-50 {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.form-row-50-50 .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Radio description text */
.radio-desc {
    font-size: 13px;
    color: #888;
    font-weight: normal;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    color: #cccccc;
    white-space: nowrap;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    padding-top: 10px;
    border-top: 2px groove #444;
}

.cover-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cover-buttons .btn {
    min-width: 200px;
}

.items-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: #0b0b14;
    border: 2px inset #333;
}

.items-group {
    margin-top: 18px;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-text {
    flex: 1;
    min-width: 160px;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.item-actions .btn {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 18px;
    letter-spacing: 0;
}

#add-item-btn {
    margin-left: auto;
    display: inline-flex;
}

/* Edit Sections */
.edit-section {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 3px ridge #ffb066;
    padding: 20px;
    margin-bottom: 30px;
    color: #cccccc;
}

.edit-section h2 {
    color: #ffcc00;
    font-family: 'Arial Black', sans-serif;
    margin: 0 0 15px 0;
}

.edit-section h3 {
    color: #cccccc;
    font-family: 'Arial Black', sans-serif;
    margin: 20px 0 15px 0;
    font-size: 16px;
}

.current-cover {
    margin-bottom: 20px;
}

.current-cover img {
    display: block;
    margin-bottom: 10px;
    border: 2px solid #999;
}

/* Fields Table */
.fields-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #0b0b14;
}

.fields-table th,
.fields-table td {
    padding: 10px;
    border: 1px solid #333;
    text-align: left;
    color: #e0e0e0;
}

.fields-table thead {
    background: linear-gradient(180deg, #5a0000 0%, #2b0000 100%);
}

.fields-table th {
    font-family: 'Arial Black', sans-serif;
    text-transform: uppercase;
    font-size: 12px;
    color: #ffcc00;
}

.fields-table tbody tr:nth-child(even) {
    background: #151526;
}

/* Danger Zone */
.danger-zone {
    border-color: #cc0000 !important;
    background: linear-gradient(180deg, #3a0000 0%, #1a0000 100%) !important;
}

.danger-zone h2 {
    color: #cc0000;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 3px ridge #444;
    margin-bottom: 30px;
}

.empty-state p {
    font-size: 18px;
    color: #aaaaaa;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .lister-grid,
    .lister-list {
        gap: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .lister-table {
        font-size: 12px;
    }

    .lister-table th,
    .lister-table td {
        padding: 6px;
    }
}
