* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
}

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

.logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
}

h1 {
    color: #333;
    margin-bottom: 6px;
    font-size: 24px;
}

.subtitle {
    color: #666;
    margin-bottom: 0;
    font-size: 13px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-input-row {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #4285f4;
}

select {
    padding: 12px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 180px;
}

select:focus {
    outline: none;
    border-color: #4285f4;
}

.search-engine-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-engine-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
    width: 60px;
    height: 60px;
}

.search-engine-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(66, 133, 244, 0.4);
}

.search-engine-wrapper:hover .search-engine-display {
    border-color: #4285f4;
}

.search-engine-display img {
    width: 20px;
    height: 20px;
    display: block;
}

.search-engine-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 15px;
}

.search-engine-select:focus + .search-engine-display {
    border-color: #4285f4;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f8f9ff;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.date-filter label {
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="date"] {
    padding: 12px 16px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s, box-shadow 0.2s;
}

input[type="date"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(66, 133, 244, 0.4);
    border-color: #4285f4;
}

input[type="date"]:focus {
    outline: none;
    border-color: #4285f4;
}

input[type="checkbox"].date-toggle {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4285f4;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background-color: #e8ecf9;
    border-radius: 8px;
    border: 2px solid #c5cae9;
}

.checkbox-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 13px;
    padding: 6px;
    background-color: #fff;
    border-radius: 6px;
}

.checkbox-group-title input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #4285f4;
}

.category-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 24px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.checkbox-group label:hover {
    background-color: #fff;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.category-header:hover {
    background-color: #fff;
}

.category-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #4285f4;
}

.category-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.expand-icon {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
    margin-left: auto;
}

.site-list.visible ~ label .expand-icon,
.category-item:has(.site-list.visible) .expand-icon {
    transform: rotate(90deg);
}

.site-list {
    display: none;
    margin-left: 32px;
    padding: 8px 12px;
    background: #fff;
    border-left: 3px solid #4285f4;
    border-radius: 4px;
    font-size: 12px;
}

.site-list.visible {
    display: block;
}

.site-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.site-list-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4285f4;
}

.site-list-item a {
    color: #4285f4;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 12px;
}

.site-list-item a:hover {
    color: #ea4335;
    text-decoration: underline;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4285f4;
}

.checkbox-group span {
    color: #555;
    font-size: 13px;
}

.site-count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

button {
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(66, 133, 244, 0.4);
}

button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    body {
        padding: 2px;
        align-items: flex-start;
    }

    .container {
        padding: 10px;
        max-width: 95%;
    }
}
