/* omniselect_lists.css */

/* =================================
    THEME VARIABLES (Light & Dark Mode)
    ================================= */
:root {
    /* Light Mode */
    --list-background: #f9f9f9;
    --list-text-color: #333;
    --list-heading-border: #ddd;
    --table-header-background: #4CAF50; /* OmniSelect Green */
    --table-header-text: white;
    --table-row-border: #eee;
    --table-row-hover-background: #e0f2f1; /* Light hover effect */
    --list-name-color: #00796B;
    --no-lists-border: #ccc;
    --no-lists-text: #777;
    --back-link-color: #4CAF50;
    --box-shadow-color: rgba(0, 0, 0, 0.1);
    /* Adding general body theme variables to make the body block work */
    --body-background: #f8f8f8; /* From omniscope.css light mode */
    --main-text-color: #333;   /* From omniscope.css light mode */
}

/* Dark Mode - Activated by System Preference or Manual Toggle */
@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Mode */
        --list-background: #2a2a2a;
        --list-text-color: #e0e0e0;
        --list-heading-border: #444;
        --table-header-background: #38703a; /* Darker Green */
        --table-header-text: #e0e0e0;
        --table-row-border: #333;
        --table-row-hover-background: #3d3d3d;
        --list-name-color: #80CBC4; /* Lighter Teal */
        --no-lists-border: #555;
        --no-lists-text: #bbb;
        --back-link-color: #81C784;
        --box-shadow-color: rgba(0, 0, 0, 0.5);
        /* Updating general body theme variables for dark mode */
        --body-background: #1c1c1c; /* From omniscope.css dark mode */
        --main-text-color: #FFFFFF; /* From omniscope.css dark mode */
    }
}

body[data-theme='dark'] {
    /* Manual Dark Mode Overrides for Lists */
    --list-background: #222;
    --list-text-color: #e0e0e0;
    --list-heading-border: #444;
    --table-header-background: #38703a;
    --table-header-text: #e0e0e0;
    --table-row-border: #333;
    --table-row-hover-background: #333;
    --list-name-color: #81C784;
    --no-lists-border: #555;
    --no-lists-text: #bbb;
    --back-link-color: #81C784;
    --box-shadow-color: rgba(0, 0, 0, 0.5);
    /* Manual Dark Mode Overrides for body theme variables */
    --body-background: #1a1a1a; /* From omniscope.css manual dark mode */
    --main-text-color: #e0e0e0; /* From omniscope.css manual dark mode */
}

/* =================================
    BODY STYLES
    ================================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--body-background);
    color: var(--main-text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* General container styling */
.lists-container {
    max-width: 100%;
    margin: 140px 20px;
    padding: 20px;
    background-color: var(--list-background);
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--box-shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.lists-container h2 {
    color: var(--list-text-color);
    border-bottom: 2px solid var(--list-heading-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: center;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* Table styling */
.lists-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.lists-table th, .lists-table td {
    padding: 12px 15px;
    text-align: left;
    color: var(--list-text-color); /* Apply text color to cells */
    transition: color 0.3s ease, border-color 0.3s ease;
}

.lists-table th {
    background-color: var(--table-header-background);
    color: var(--table-header-text);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    border-bottom: 1px solid var(--table-row-border);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Table row styling */
.list-row, .list-desc-row {
    transition: background-color 0.2s ease;
}

/* Remove bottom border from the top row so it visually merges with the description */
.list-row td {
    padding-bottom: 6px; 
}

/* Style the bottom description row and give it the final bottom border */
.list-desc-row td {
    padding-top: 2px;
    padding-bottom: 14px;
    font-size: 0.9em;
    opacity: 0.8;
    border-bottom: 1px solid var(--table-row-border); 
}

/* Cohesive Hover Effect */
.list-row:hover, 
.list-desc-row:hover,
.list-row:hover + .list-desc-row {
    background-color: var(--table-row-hover-background);
    cursor: pointer;
}

.list-name-cell {
    font-weight: 600;
    color: var(--list-name-color);
    transition: color 0.3s ease;
}

/* Subtle styling for the description text label */
.list-desc-cell strong {
    font-weight: 600;
    color: var(--list-name-color);
}

/* Action Button/Link styling */
.view-btn, .edit-btn {
    display: inline-block;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.2s, color 0.2s;
    margin-right: 5px;
}

.view-btn {
    background-color: #e0e0e0;
    color: #333;
}
.view-btn:hover {
    background-color: #ccc;
}

.edit-btn {
    background-color: #FF9800; /* Amber style color */
    color: white;
}
.edit-btn:hover {
    background-color: #E65100;
}

/* Status Pill Indicators */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}
.status-edit {
    background-color: #FFE082;
    color: #5D4037;
}
.status-finalised {
    background-color: #C8E6C9;
    color: #2E7D32;
}

/* Messages and links */
.no-lists-message {
    text-align: center;
    padding: 30px;
    border: 1px dashed var(--no-lists-border);
    border-radius: 5px;
    color: var(--no-lists-text);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.list-count {
    margin-bottom: 10px;
    color: var(--no-lists-text);
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.back-link {
    margin-top: 30px;
    text-align: center;
}
.back-link a {
    color: var(--back-link-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
.back-link a:hover {
    text-decoration: underline;
}

/* Device type and size cells */
.device-type-cell {
    font-weight: 600;
    color: var(--list-name-color);
}

.device-size-cell {
    white-space: nowrap;
}