* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Menu - matching debidadiligencia-home */
.nav-menu {
    background: linear-gradient(90deg, #003473 0%, #425500 100%);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.nav-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5em;
    color: white;
}

.nav-links {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 5px 15px;
    margin: 0 5px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: inline-block;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.2);
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    flex: 1;
}

.header {
    background: linear-gradient(135deg, #003473 0%, #425500 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.search-form {
    padding: 40px;
    background: #f8f9fa;
}

/* Search Type Toggle */
.search-type-toggle {
    margin-bottom: 30px;
    text-align: center;
}

.toggle-label {
    display: block;
    font-weight: 600;
    color: #425500;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.toggle-buttons {
    display: inline-flex;
    gap: 0;
    background: #e0e0e0;
    border-radius: 30px;
    padding: 5px;
}

.toggle-btn {
    padding: 12px 30px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    color: #003473;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #003473 0%, #425500 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 52, 115, 0.3);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #425500;
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #003473;
    box-shadow: 0 0 0 3px rgba(0, 52, 115, 0.1);
}

.search-button {
    background: linear-gradient(135deg, #003473 0%, #002050 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 52, 115, 0.3);
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 52, 115, 0.4);
}

.search-button:active {
    transform: translateY(0);
}

.search-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.report-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.report-button {
    background: linear-gradient(135deg, #003473 0%, #002050 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 52, 115, 0.3);
}

.report-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 52, 115, 0.4);
}

#copyTextBtn {
    background: linear-gradient(135deg, #425500 0%, #2a3600 100%);
}

#downloadHTMLBtn {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

#downloadWordBtn {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

#downloadPDFBtn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #003473;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    padding: 40px;
    display: none;
}

.results.active {
    display: block;
}

.database-section {
    margin-bottom: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.database-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.database-header h3 {
    color: #003473;
    font-size: 1.3em;
}

.match-count {
    background: #e74c3c;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.match-count.no-matches {
    background: #27ae60;
}

.database-content {
    padding: 20px;
}

.match-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.match-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.match-item h4 {
    color: #003473;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.match-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.detail-item {
    font-size: 0.9em;
}

.detail-label {
    font-weight: 600;
    color: #666;
}

.detail-value {
    color: #333;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.no-matches {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}

.explanation {
    padding: 40px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.explanation h2 {
    color: #003473;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.explanation p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.explanation ul {
    color: #555;
    line-height: 1.8;
    margin-left: 20px;
}

.sources {
    padding: 40px;
    background: #f8f9fa;
}

.sources h2 {
    color: #003473;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.source-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.source-item h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.source-item ul {
    list-style: none;
    padding: 0;
}

.source-item li {
    margin-bottom: 8px;
    color: #666;
}

.source-item a {
    color: #003473;
    text-decoration: none;
    transition: color 0.3s ease;
}

.source-item a:hover {
    color: #425500;
    text-decoration: underline;
}

/* Footer - matching debidadiligencia-home */
.footer {
    background: #1a1a1a;
    color: white;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-menu {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.footer-menu a {
    color: #84bd00;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: #a4dd00;
}

.footer-credits {
    color: #999;
}

.footer-credits a {
    color: #84bd00;
    text-decoration: none;
}

.footer-credits a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(90deg, #003473 0%, #425500 100%);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .container {
        margin: 20px 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }

    .search-form {
        padding: 20px;
    }

    .results {
        padding: 20px;
    }

    .explanation {
        padding: 20px;
    }

    .sources {
        padding: 20px;
    }
    
    .footer-menu {
        flex-direction: column;
        gap: 15px;
    }
}
