/* 5e Artisanal Database Shared Styles */

body {
    max-width: 800px;
    margin: auto;
    font-size: 18px;
    font-family: sans-serif;
    padding: 10px;
}

p, li {
    line-height: 1.5em;
}

table {
    border-collapse: collapse;
}

th, td {
    border: 1px solid black;
    padding: 5px;
    text-align: left;
}

button, select {
    font-size: 18px;
    min-height: 44px;
    padding: 12px 16px;
    margin: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

button:hover {
    background-color: #e9e9e9;
}

/* Main page search styles */
.main-search-container {
    margin: 20px 0;
    padding: 0;
    max-width: 500px;
}

.main-search-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: white;
    margin-bottom: 5px;
}

.main-search-input:focus {
    border-color: #888;
    outline: none;
}

.search-buttons {
    text-align: left;
}

.search-buttons button {
    background-color: #f8f9fa;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
    margin: 0 5px;
    min-height: auto;
}

.search-buttons button:hover {
    box-shadow: 0 1px 1px rgba(0,0,0,.1);
    background-color: #f1f3f4;
    border: 1px solid #dadce0;
    color: #202124;
}

/* Filter styles for main page */
.filter-container {
    margin: 10px 0;
    padding: 0;
    background-color: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #ddd;
    max-width: 500px;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    cursor: pointer;
    user-select: none;
}

.filter-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.filter-toggle {
    font-size: 18px;
    color: #666;
    transition: transform 0.2s ease;
}

.filter-toggle.collapsed {
    transform: rotate(-90deg);
}

.filter-content {
    padding: 15px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.filter-content.collapsed {
    max-height: 0;
    padding: 0 15px;
    opacity: 0;
}

.source-filters {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 15px;
}

.filter-section {
    margin-bottom: 15px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.section-toggle {
    margin-left: auto;
    font-size: 16px;
    color: #666;
    transition: transform 0.2s ease;
}

.section-toggle.collapsed {
    transform: rotate(-90deg);
}

.filter-subsection {
    margin-left: 25px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.filter-subsection.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.filter-subsection-title {
    font-weight: 600;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
}

.source-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    margin-bottom: 4px;
    background-color: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s;
}

.source-filter:hover {
    background-color: #f0f0f0;
}

.source-filter input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.source-filter-label {
    flex: 1;
    cursor: pointer;
    font-size: 16px;
    color: #333;
}

.source-filter-count {
    font-size: 12px;
    color: #666;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.filter-actions button {
    background-color: #666;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    min-height: auto;
}

.filter-actions button:hover {
    background-color: #555;
}