* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.7;
}

main {
    padding: 40px;
}

.search-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.url-lookup {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 2px solid #e2e8f0;
}

select, input[type="text"] {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

select {
    cursor: pointer;
    background-color: white;
}

.search-results {
    background: #f7fafc;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.search-placeholder {
    text-align: center;
    color: #4a5568;
    line-height: 1.6;
}

.search-placeholder small {
    color: #718096;
    font-size: 0.85rem;
}

label {
    font-weight: 600;
    color: #2d3748;
}



#lookup-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#lookup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#lookup-btn:active {
    transform: translateY(0);
}

#lookup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.status.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.status.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.status.loading {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

.metadata {
    background: #f7fafc;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.meta-item {
    font-size: 0.9rem;
}

.meta-item strong {
    color: #2d3748;
}

.viewer-container {
    width: 100%;
    height: 600px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

#html-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

.hidden {
    display: none;
}

footer {
    background: #f7fafc;
    padding: 30px;
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 5px;
}

.security-note {
    font-size: 0.85rem;
    color: #4a5568;
}

.legal-link {
    font-size: 0.85rem;
    margin-top: 10px;
}

.legal-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.legal-link a:hover {
    text-decoration: underline;
}

/* Legal Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-body {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 10px;
}

.modal-footer-text {
    margin-top: 15px;
    font-size: 0.9rem;
}

.modal-footer-text a {
    color: #667eea;
    font-weight: 600;
}

.accept-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.accept-btn:hover {
    transform: translateY(-2px);
}

/* Watermark Styles */
.viewer-container {
    width: 100%;
    height: 600px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.watermark {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10;
    pointer-events: none;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 20px;
    }
    
    .viewer-container {
        height: 400px;
    }
}
