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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 3px solid #667eea;
}

header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-right: 1px solid #dee2e6;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button.active {
    background: #667eea;
    color: white;
}

.tab-button:hover:not(.active) {
    background: #e9ecef;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.search-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* Dropdown Styles */
.dropdown-container {
    position: relative;
    width: 100%;
}

.dropdown-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.dropdown-button:hover {
    border-color: #667eea;
}

.dropdown-button.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dropdown-arrow {
    font-weight: bold;
    transition: transform 0.3s ease;
}

.dropdown-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.dropdown-content.show {
    display: block;
}

.search-filter {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.search-filter input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9rem;
    margin: 0;
}

.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 5px 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.checkbox-item:hover {
    background-color: #f8f9fa;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0 10px 0 0;
    transform: scale(1.1);
}

.checkbox-item label {
    flex: 1;
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    font-size: 0.95rem;
}

.checkbox-item.filtered-out {
    display: none;
}

.selected-items {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.selected-item {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-item {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.remove-item:hover {
    color: #ffcccb;
}

.search-form h2 {
    color: #495057;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

input[type="text"], 
input[type="number"], 
input[type="date"], 
select, 
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-range {
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-range span {
    font-weight: 600;
    color: #495057;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.2);
}

/* Buttons */
.search-button, .generate-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-button:hover, .generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.generate-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.generate-button:hover {
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

/* Results Section */
.results-section, .table-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.results-section h2, .table-section h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.query-display {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    white-space: pre-wrap;
    display: none;
}

.query-display.show {
    display: block;
}

.curl-display {
    background: #1a202c;
    color: #68d391;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    white-space: pre-wrap;
    display: none;
    border: 2px solid #68d391;
}

.curl-display.show {
    display: block;
}

.copy-button {
    background: #68d391;
    color: #1a202c;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
}

.copy-button:hover {
    background: #4fd1c7;
}

.warning-message {
    background: #fed7d7;
    color: #9b2c2c;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    margin-bottom: 20px;
}

.warning-message h3 {
    margin-bottom: 10px;
}

.warning-message ul {
    margin-left: 20px;
    margin-top: 10px;
}

.search-options {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 2px solid #667eea;
}

.search-options h3 {
    color: #495057;
    margin-bottom: 20px;
    text-align: center;
}

.option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.option-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.option-card.recommended {
    border-color: #28a745;
    background: #f8fff8;
}

.option-card.recommended:hover {
    border-color: #20c997;
}

.option-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.option-card h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.option-card p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.try-button {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
}

.option-card.recommended .try-button {
    background: #28a745;
}

.badge {
    position: absolute;
    top: -8px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.manual-tools {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.manual-tools h3 {
    color: #495057;
    margin-bottom: 20px;
    text-align: center;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tool-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.tool-card h4 {
    color: #495057;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.tool-card p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.tool-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-button:hover {
    background: #5a6268;
}

.postman-display {
    background: #ff6b35;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    display: none;
}

.postman-display.show {
    display: block;
}

.postman-display h3 {
    margin-bottom: 15px;
    color: white;
}

.download-button {
    background: #fff;
    color: #ff6b35;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
}

.download-button:hover {
    background: #f8f9fa;
}

.info-message {
    background: #d1ecf1;
    color: #0c5460;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #bee5eb;
    margin-bottom: 20px;
}

.info-message h4 {
    margin-bottom: 10px;
}

#proxyStatus {
    margin-top: 10px;
    font-family: monospace;
    font-size: 0.9rem;
}

.proxy-test {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.proxy-test .status {
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.proxy-test .status.success {
    background: #c6f6d5;
    color: #22543d;
}

.proxy-test .status.error {
    background: #fed7d7;
    color: #742a2a;
}

.api-tester-info {
    background: #e3f2fd;
    color: #1565c0;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.9rem;
}

.api-tester-info a {
    color: #0d47a1;
    text-decoration: none;
    font-weight: 600;
}

.api-tester-info a:hover {
    text-decoration: underline;
}

/* Search Results */
.result-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: #fdfdfd;
    transition: all 0.3s ease;
}

.result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.result-title {
    color: #667eea;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-decoration: none;
}

.result-title:hover {
    text-decoration: underline;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #6c757d;
}

.result-meta span {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
}

.result-description {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 10px;
}

.result-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.keyword-tag {
    background: #667eea;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.data-table th {
    background: #667eea;
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #5a67d8;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.data-table tr:nth-child(even) {
    background: #f8f9fa;
}

.data-table tr:hover {
    background: #e3f2fd;
}

.cell-content {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-content.expandable {
    cursor: pointer;
    color: #667eea;
}

.cell-content.expanded {
    white-space: normal;
    max-width: none;
}

.stats-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Import Section */
.import-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.import-section h2 {
    color: #495057;
    margin-bottom: 20px;
}

#jsonData {
    min-height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .date-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .checkbox-group {
        flex-direction: column;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Error States */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    margin-bottom: 20px;
}