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

.main-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e0e0e0;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar-search {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-search .search-form {
    display: flex;
    gap: 8px;
}

.sidebar-search #search-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
}

.sidebar-search #search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.sidebar-search #search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s ease;
    min-width: 40px;
}

.sidebar-search #search-btn:hover {
    transform: translateY(-1px);
}

.sidebar-search #search-btn:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 500;
}

.sidebar-content {
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.query-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.query-item:hover {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding-left: 16px;
}

.query-item.active {
    background: #e3f2fd;
    border-left: 4px solid #667eea;
    padding-left: 16px;
}

.query-text {
    font-size: 0.9em;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.query-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: #666;
}

.query-number {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
}

.main-content {
    flex: 1;
    margin-left: 300px;
    padding: 20px;
    max-width: calc(100vw - 340px);
}

.no-queries {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
}

.header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-size: 1.1em;
}

.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #f8d7da;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

.log-entry {
    background: white;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.log-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-number {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.timestamp {
    color: #666;
    font-size: 0.9em;
    cursor: help;
    border-bottom: 1px dotted #999;
    transition: color 0.2s ease;
}

.timestamp:hover {
    color: #333;
}

.query-section, .results-section {
    padding: 20px;
}

.query-section {
    border-bottom: 1px solid #eee;
}

.query-section h4, .results-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.query-section .query-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    font-style: italic;
    color: #333;
}

.result-item {
    background: #f9f9f9;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.result-number {
    font-weight: bold;
    color: #28a745;
}

.score {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.result-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.result-text {
    color: #333;
    font-size: 0.95em;
    line-height: 1.5;
}

.score-explanation {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 3px solid #2196f3;
}

.score-explanation small {
    color: #1976d2;
}

.no-logs {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.2em;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar-refresh {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
    margin-top: auto;
}

.refresh-btn {
    background: #667eea;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    width: 100%;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.refresh-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        box-shadow: none;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 10px;
    }
    .main-container {
        flex-direction: column;
    }
    .sidebar-search .search-form {
        flex-direction: row;
        gap: 8px;
    }
    .sidebar-search #search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    .header { padding: 20px; }
    .header h1 { font-size: 2em; }
    .log-header { flex-direction: column; gap: 5px; }
    .result-header { flex-direction: column; align-items: flex-start; gap: 5px; }
}

/* Password overlay styles */
:root {
    --overlay-display: flex; /* Default to showing the overlay */
}

.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: var(--overlay-display);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.password-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.password-box h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.8em;
}

.password-box p {
    color: #666;
    margin-bottom: 25px;
}

.password-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: center;
    transition: border-color 0.3s ease;
}

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

.password-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 100%;
}

.password-btn:hover {
    transform: translateY(-1px);
}

.password-error {
    color: #dc3545;
    margin-top: 15px;
    font-size: 0.9em;
}

.main-content-hidden {
    display: none;
}
