:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --border-color: #e2e8f0;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --text-secondary: #64748b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Site Header */
.site-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-brand {
    display: flex;
    flex-direction: column;
    margin-right: auto;
}

.brand-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: -0.2rem;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--background-color);
    color: var(--primary-color);
}

.header-search {
    min-width: 250px;
}

.global-search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.global-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Main Content Area */
main {
    flex: 1;
}

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

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero-section h2 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about-section {
    margin: 4rem 0;
    padding: 3rem 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.about-content {
    text-align: center;
}

.about-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.about-content > p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature {
    text-align: center;
}

.feature h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Issue Section */
.issue-section {
    margin: 4rem 0;
    padding: 3rem 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.issue-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.issue-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.issue-content > p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0 auto 3rem;
}

.issue-content .issue-form {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

/* Site Footer */
.site-footer {
    background: var(--text-color);
    color: white;
    margin-top: auto;
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;

    grid-template-columns: 2fr 1fr 1fr 1fr;

    gap: 3rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.footer-section h4 {
    font-size: 1rem;
}

.footer-section p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* App Links Styling */
.app-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: block;
    padding: 0.2rem 0;
}

.app-links a:hover {
    color: var(--primary-color);
    transform: translateX(2px);
}



.social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #374151;
    color: #94a3b8;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.footer-bottom {
    border-top: 1px solid #374151;
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

.upload-section {
    margin-bottom: 3rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
    transform: scale(1.02);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-area h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.processing-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.results-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h2 {
    color: var(--text-color);
    margin: 0;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--background-color);
    color: var(--text-color);
}

.table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

td {
    vertical-align: top;
}

tr:hover {
    background: #f8fafc;
}

.link-text {
    font-weight: 500;
    color: var(--text-color);
}

.url {
    color: var(--primary-color);
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.url a {
    color: inherit;
    text-decoration: none;
}

.url a:hover {
    text-decoration: underline;
}

.context {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 300px;
    word-wrap: break-word;
}

.source-file {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.results-summary {
    padding: 1rem 1.5rem;
    background: var(--background-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.error-message {
    background: #fef2f2;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    border: 1px solid #bbf7d0;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .header-brand {
        text-align: center;
        margin-right: 0;
    }
    
    .header-nav {
        justify-content: center;
        gap: 1rem;
    }
    
    .header-search {
        min-width: auto;
    }
    
    .hero-section h2 {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-actions {
        justify-content: stretch;
    }
    
    .search-input {
        min-width: auto;
        flex: 1;
    }
    
    .table-container {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* Hidden utility */
[hidden] {
    display: none !important;
}

/* Issue Form Styles */
.issue-form {
    max-width: 300px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.submit-issue-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.submit-issue-btn:hover {
    background: var(--primary-hover);
}

.submit-issue-btn:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

.form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.form-message.success {
    background: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #bbf7d0;
}

.form-message.error {
    background: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

/* Bookmark Styles */
.bookmarks-section {
    margin: 2rem 0;
}

.bookmarks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.bookmarks-header h2 {
    color: var(--primary-color);
    margin: 0;
}

.bookmarks-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bookmark-cell {
    text-align: center;
    width: 60px;
}

.bookmark-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #ccc;
}

.bookmark-btn:hover {
    background: var(--background-color);
    transform: scale(1.1);
}

.bookmark-btn.bookmarked {
    color: #fbbf24;
}

.bookmark-btn.bookmarked:hover {
    color: #f59e0b;
}

/* Responsive adjustments for bookmarks */
@media (max-width: 768px) {
    .bookmarks-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bookmarks-actions {
        justify-content: center;
    }
}