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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background-color: #0f172a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f1f5f9;
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid #334155;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.header-actions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

header p a {
    color: #60a5fa;
    text-decoration: none;
}

header p a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.header-logo {
    max-width: 120px;
    height: auto;
    margin-top: 1rem;
    opacity: 0.8;
}

main {
    padding: 2rem 0;
}

.search-section {
    background: #1e293b;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-top: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #334155;
}

.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#searchInput {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #475569;
    border-radius: 5px;
    font-size: 1rem;
    background: #0f172a;
    color: #e2e8f0;
}

#searchInput:focus {
    outline: none;
    border-color: #3b82f6;
}

#searchButton, #clearFilters {
    padding: 0.75rem 1.5rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#searchButton:hover, #clearFilters:hover {
    background: #2563eb;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #cbd5e1;
}

.filter-group select {
    padding: 0.5rem;
    border: 2px solid #475569;
    border-radius: 5px;
    font-size: 0.9rem;
    background: #0f172a;
    color: #e2e8f0;
}

.filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.results-section {
    background: #1e293b;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 1px solid #334155;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #475569;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.per-page-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-control label {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
}

.per-page-control select {
    background: #0f172a;
    border: 2px solid #475569;
    color: #e2e8f0;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.per-page-control select:focus {
    outline: none;
    border-color: #3b82f6;
}

#resultsCount {
    font-size: 1.1rem;
    font-weight: 600;
    color: #cbd5e1;
}

.query-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.query-card {
    border: 2px solid #475569;
    border-radius: 10px;
    padding: 1.5rem;
    background: #0f172a;
    transition: all 0.3s;
}

.query-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.query-header {
    margin-bottom: 1rem;
}

.query-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.mitre-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.mitre-id {
    font-size: 0.8rem;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
    background: #334155;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
}

.query-description {
    margin-bottom: 1rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.query-meta {
    margin-bottom: 1rem;
}

.meta-row {
    display: flex;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.meta-label {
    font-weight: 600;
    color: #e2e8f0;
    min-width: 60px;
}

.meta-value {
    color: #94a3b8;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #3b82f6;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.log-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.log-source {
    background: #10b981;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.query-code {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Custom scrollbar styling for query code blocks */
.query-code::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.query-code::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 4px;
}

.query-code::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

/* Custom scrollbar styling for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

.query-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.copy-button, .falcon-button {
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s;
    color: white;
}

.copy-button {
    background: #10b981;
}

.copy-button:hover {
    background: #059669;
}

.copy-button.copied {
    background: #64748b;
}

.falcon-button {
    background: #f59e0b;
}

.falcon-button:hover {
    background: #d97706;
}

.falcon-button.disabled,
.falcon-button:disabled {
    background: #64748b;
    cursor: not-allowed;
    opacity: 0.6;
    position: relative;
}

.falcon-button.disabled:hover,
.falcon-button:disabled:hover {
    background: #64748b;
}

/* Tooltip styles */
.falcon-button.disabled::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    border: 1px solid #4a5568;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.falcon-button.disabled::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1a202c;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.falcon-button.disabled:hover::before,
.falcon-button.disabled:hover::after {
    opacity: 1;
    visibility: visible;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-results h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #e2e8f0;
}

footer {
    background: #1e293b;
    color: #cbd5e1;
    text-align: center;
    padding: 1rem 0;
    margin-top: 3rem;
    border-top: 1px solid #334155;
}

footer p a {
    color: #60a5fa;
    text-decoration: none;
}

footer p a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    margin: 2% auto;
    padding: 0;
    border: 1px solid #475569;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    max-height: 90%;
    overflow-y: scroll;
    overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: #f1f5f9;
    padding: 1.5rem;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #64748b;
}

.modal-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.modal-title-container {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.modal-author {
    font-style: italic;
    color: #cbd5e1;
    font-size: 1rem;
    opacity: 0.9;
}

.github-logo {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.github-logo:hover {
    opacity: 1;
    transform: scale(1.1);
}

.close {
    color: #cbd5e1;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: #f87171;
}

.modal-body {
    padding: 2rem;
    color: #e2e8f0;
}

.modal-mitre-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-mitre-ids .mitre-id {
    font-size: 0.9rem;
    padding: 0.3rem 0.7rem;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #cbd5e1;
}

.modal-meta {
    background: #2d3748;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #4a5568;
}

.modal-meta .meta-row {
    display: flex;
    margin-bottom: 0.7rem;
    font-size: 1rem;
}

.modal-meta .meta-row:last-child {
    margin-bottom: 0;
}

.modal-section-heading-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #475569;
}

.modal-section-heading {
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Standalone section headings without buttons */
.modal-tags .modal-section-heading,
.modal-log-sources .modal-section-heading,
.modal-explanation .modal-section-heading {
    margin: 0 0 0.8rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #475569;
}

.modal-section-buttons {
    display: flex;
    gap: 0.75rem;
}

.modal-section-buttons .copy-button,
.modal-section-buttons .falcon-button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.modal-section-content {
    margin-bottom: 1.5rem;
}

.modal-tags {
    margin-bottom: 1.5rem;
}

.modal-tags .tag {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.modal-log-sources {
    margin-bottom: 1.5rem;
}

.modal-log-sources .log-source {
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.modal-explanation {
    background: #2d3748;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #4a5568;
    line-height: 1.6;
}

.modal-explanation h1,
.modal-explanation h2,
.modal-explanation h3 {
    color: #f1f5f9;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.modal-explanation h1:first-child,
.modal-explanation h2:first-child,
.modal-explanation h3:first-child {
    margin-top: 0;
}

.modal-explanation p {
    margin-bottom: 1rem;
}

.modal-explanation ol,
.modal-explanation ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.modal-explanation li {
    margin-bottom: 0.5rem;
}

.modal-explanation code {
    background: #1a202c;
    color: #68d391;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.modal-explanation strong {
    color: #f1f5f9;
    font-weight: 600;
}

.modal-explanation a {
    color: #60a5fa;
    text-decoration: none;
}

.modal-explanation a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.modal-explanation table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 6px;
    overflow: hidden;
}

.modal-explanation th,
.modal-explanation td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #4a5568;
}

.modal-explanation th {
    background: #2d3748;
    color: #f1f5f9;
    font-weight: 600;
    border-bottom: 2px solid #4a5568;
}

.modal-explanation td {
    color: #e2e8f0;
}

.modal-explanation tr:last-child td {
    border-bottom: none;
}

.modal-explanation tr:nth-child(even) {
    background: #2d3748;
}

.modal-code {
    margin-bottom: 1.5rem;
}

.modal-code .modal-section-content {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    max-height: 700px;
    overflow: auto;
    border: 1px solid #4a5568;
    margin-bottom: 0;
}

/* Custom scrollbar styling for modal code blocks */
.modal-code .modal-section-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-code .modal-section-content::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 4px;
}

.modal-code .modal-section-content::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

.modal-code .modal-section-content::-webkit-scrollbar-thumb:hover {
    background: #68d391;
}

.modal-code pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #4a5568;
}

.modal-actions .copy-button,
.modal-actions .falcon-button {
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Make query cards clickable */
.query-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.query-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .query-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}

/* YAML Builder Button */
.yaml-builder-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.yaml-builder-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* YAML Builder Modal Styles */
.yaml-builder-modal {
    max-width: 800px;
}

.yaml-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    background: #0f172a;
    border: 2px solid #475569;
    color: #e2e8f0;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
    font-family: 'Courier New', monospace;
}

.form-group textarea#yamlCql,
.form-group textarea#yamlExplanation {
    font-family: 'Courier New', monospace;
}

.form-group textarea#yamlDescription {
    font-family: inherit;
}

.form-help {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.preview-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.preview-button:hover {
    background: #2563eb;
}

.preview-button.active {
    background: #059669;
}

.markdown-preview {
    background: #2d3748;
    border: 2px solid #475569;
    padding: 1rem;
    border-radius: 6px;
    color: #e2e8f0;
    margin-top: 0.5rem;
    min-height: 100px;
    line-height: 1.6;
    overflow-y: auto;
    max-height: 400px;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.markdown-preview h1:first-child,
.markdown-preview h2:first-child,
.markdown-preview h3:first-child,
.markdown-preview h4:first-child,
.markdown-preview h5:first-child,
.markdown-preview h6:first-child {
    margin-top: 0;
}

.markdown-preview p {
    margin-bottom: 1rem;
}

.markdown-preview ol,
.markdown-preview ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.markdown-preview li {
    margin-bottom: 0.5rem;
}

.markdown-preview code {
    background: #1a202c;
    color: #68d391;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-preview pre {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-preview pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.markdown-preview strong {
    color: #f1f5f9;
    font-weight: 600;
}

.markdown-preview a {
    color: #60a5fa;
    text-decoration: none;
}

.markdown-preview a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.markdown-preview blockquote {
    border-left: 4px solid #475569;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #cbd5e1;
    font-style: italic;
}

.markdown-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 6px;
    overflow: hidden;
}

.markdown-preview th,
.markdown-preview td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #4a5568;
}

.markdown-preview th {
    background: #334155;
    color: #f1f5f9;
    font-weight: 600;
    border-bottom: 2px solid #4a5568;
}

.markdown-preview td {
    color: #e2e8f0;
}

.markdown-preview tr:last-child td {
    border-bottom: none;
}

.markdown-preview tr:nth-child(even) {
    background: #334155;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #475569;
}

.download-button {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-button:hover {
    background: #059669;
    transform: translateY(-1px);
}

.reset-button {
    background: #64748b;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.reset-button:hover {
    background: #475569;
}

/* Responsive adjustments for YAML Builder */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .yaml-builder-modal {
        width: 95%;
        margin: 1% auto;
        max-height: 95%;
    }
    
    .form-section {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .download-button,
    .reset-button {
        width: 100%;
    }
    
    .explanation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .preview-button {
        align-self: flex-end;
    }
}

/* Pagination Styles */
.pagination-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #475569;
}

.pagination-info {
    text-align: center;
    margin-bottom: 1rem;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    background: #334155;
    color: #e2e8f0;
    border: 2px solid #475569;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 44px;
}

.pagination-btn:hover:not(:disabled) {
    background: #3b82f6;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    background: #1e293b;
    color: #64748b;
    cursor: not-allowed;
    border-color: #334155;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    background: #334155;
    color: #e2e8f0;
    border: 2px solid #475569;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

.page-number:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.page-number.active {
    background: #10b981;
    border-color: #10b981;
    color: white;
    font-weight: 600;
}

.page-ellipsis {
    color: #94a3b8;
    padding: 0.5rem 0.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 0.25rem;
    }
    
    .pagination-btn,
    .page-number {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 36px;
    }
    
    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .per-page-control {
        align-self: flex-end;
    }
}