/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (min-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Card Styles */
.lookup-card, .api-response-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lookup-card:hover, .api-response-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2, .card-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header p {
    opacity: 0.9;
    margin-top: 5px;
    font-size: 0.95rem;
}

/* Input Section */
.input-section {
    padding: 30px;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-button {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.input-with-button input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.input-with-button input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.input-with-button input::placeholder {
    color: #a0aec0;
}

.lookup-button {
    padding: 16px 30px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.lookup-button:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.lookup-button:active {
    transform: translateY(0);
}

.lookup-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-hint {
    font-size: 0.9rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* API Info */
.api-info {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #3498db;
}

.api-info h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.info-item code {
    background: #edf2f7;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #2d3748;
    overflow-x: auto;
}

.auth-status {
    color: #e74c3c;
    font-weight: 600;
    background: #ffeaea;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
}

/* Results Section */
.results-section {
    padding: 0 30px 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #edf2f7;
}

.section-header h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

#resultCount {
    font-weight: 600;
    color: #3498db;
    background: #ebf5fb;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
}

.cache-badge {
    font-weight: 600;
    color: #f39c12;
    background: #fef5e7;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
}

/* Loading, Error, and Data Containers */
.loading-container, .error-container, .data-container {
    display: none;
}

.loading-container.active, .error-container.active, .data-container.active {
    display: block;
}

/* Loading Spinner */
.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-container p {
    color: #4a5568;
    font-size: 1.1rem;
}

/* Error Container */
.error-container {
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.error-icon {
    font-size: 3rem;
    color: #e53e3e;
    text-align: center;
    margin-bottom: 15px;
}

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

.error-content h4 {
    color: #c53030;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.error-content p {
    color: #718096;
    margin-bottom: 20px;
}

.retry-button {
    padding: 12px 25px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.retry-button:hover {
    background: #c53030;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 50px 20px;
    color: #718096;
}

.no-data i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.no-data h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #4a5568;
}

.no-data p {
    max-width: 500px;
    margin: 0 auto 25px;
    font-size: 1.1rem;
}

.example-plates {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.example-tag {
    background: #edf2f7;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-tag:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

/* Vehicle Cards */
.vehicle-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 20px;
}

.vehicle-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #edf2f7;
}

.vehicle-plate {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.vehicle-status {
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-registered {
    background: #d4edda;
    color: #155724;
}

.status-other {
    background: #fff3cd;
    color: #856404;
}

.vehicle-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

@media (min-width: 768px) {
    .vehicle-details {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 992px) {
    .vehicle-cards {
        grid-template-columns: 1fr;
    }
    
    .vehicle-details {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .vehicle-details {
        grid-template-columns: repeat(5, 1fr);
    }
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1.1rem;
    color: #2d3748;
    font-weight: 500;
    word-break: break-word;
}

.detail-value.null {
    color: #cbd5e0;
    font-style: italic;
}

/* API Response Card */
.api-response-card .card-header {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.toggle-button {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.response-container {
    padding: 25px;
    max-height: 400px;
    overflow-y: auto;
}

#rawResponse {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* Footer */
.footer {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr;
    }
}

.footer-info h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-info p {
    color: #718096;
    margin-bottom: 20px;
    max-width: 500px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #2980b9;
}

.footer-status {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #bdc3c7;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #2ecc71;
    animation: none;
}

.status-dot.error {
    background: #e74c3c;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-weight: 600;
    color: #4a5568;
}

.footer-note {
    font-size: 0.9rem;
    color: #718096;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.version-info {
    font-size: 0.85rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    background: #f7fafc;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .lookup-button {
        width: 100%;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .result-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .vehicle-cards {
        grid-template-columns: 1fr;
    }
    
    .vehicle-details {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}
