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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav a:hover,
.nav a.active {
    background: rgba(255,255,255,0.2);
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: #e9ecef;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
    gap: 1rem;
}

.tab-content.active {
    display: flex;
}

.tab-content input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.tab-content input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s;
}

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

/* Results Section */
.results {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.results-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.results-header h4 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.result-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
    transition: transform 0.3s;
}

.result-card:hover {
    transform: translateY(-2px);
}

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

.pincode-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #218838;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

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

.detail-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.detail-value {
    font-size: 1rem;
    color: #333;
}

/* Trending and Latest Sections */
.trending-section,
.latest-section,
.states-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.trending-section h3,
.latest-section h3,
.states-section h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.trending-grid,
.latest-grid,
.states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.trending-item,
.latest-item,
.state-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid #667eea;
}

.trending-item:hover,
.latest-item:hover,
.state-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.trending-term,
.latest-term,
.state-name {
    font-weight: 600;
    color: #2c3e50;
    display: block;
}

.trending-count,
.latest-date,
.state-count {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    display: block;
}

/* Features Section */
.features {
    padding: 3rem 0;
}

.features h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

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

.feature-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* States Pages */
.page-header {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.breadcrumb {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

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

.search-section {
    margin-bottom: 2rem;
}

.state-search-input {
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
}

.states-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.state-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
}

.state-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

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

.state-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

.state-count {
    background: #667eea;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
}

.view-link {
    color: #667eea;
    font-weight: 500;
}

/* State Detail Page */
.state-stats {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stats-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    gap: 0.5rem;
}

.stat-label {
    font-weight: 600;
    color: #666;
}

.stat-value {
    color: #2c3e50;
    font-weight: 600;
}

.pincodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.pincode-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.pincode-card:hover {
    transform: translateY(-2px);
}

.pincode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.pincode-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.pincode-details {
    display: grid;
    gap: 0.5rem;
}

.detail-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding: 0.3rem 0;
}

.detail-row .detail-label {
    font-weight: 600;
    color: #666;
}

.detail-row .detail-value {
    color: #333;
}

.load-more-section {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.load-more-btn:hover {
    background: #5a6fd8;
}

/* Admin Panel Styles */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.login-container input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
}

.login-container button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.login-info {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.admin-panel {
    min-height: 100vh;
    background: #f8f9fa;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav {
    display: flex;
    gap: 1rem;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.2);
}

.admin-container {
    display: flex;
    min-height: calc(100vh - 80px);
}

.admin-sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 2rem 0;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    padding: 1rem 2rem;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

.admin-content {
    flex: 1;
    padding: 2rem;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-section h2 {
    margin-bottom: 2rem;
    color: #2c3e50;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
}

.stat-status {
    font-size: 1.2rem;
    font-weight: 600;
    color: #28a745;
}

.stat-info {
    font-size: 1rem;
    color: #666;
}

.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.action-btn:hover,
.action-btn.primary {
    background: #667eea;
    color: white;
}

.data-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.management-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.fetch-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.fetch-controls label {
    font-weight: 600;
    color: #666;
}

.fetch-controls select {
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.progress-info {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #667eea;
    width: 0%;
    transition: width 0.3s;
}

.db-stats {
    display: grid;
    gap: 0.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.api-info-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.api-info-card code {
    background: #e9ecef;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-family: monospace;
    word-break: break-all;
}

.api-info {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* AdSense Styles */
.adsense-placeholder {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    padding: 20px;
    text-align: center;
    color: #666;
    margin: 10px 0;
    border-radius: 5px;
}

/* Contact Form Styles */
.contact-form-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.contact-form-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.contact-form {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #666;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.contact-message-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
}

.contact-message-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.contact-message-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Contact Submissions Styles */
.contact-submissions-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.contact-submissions-header h4 {
    color: #2c3e50;
}

.contact-submission-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
}

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

.submission-header h5 {
    margin: 0;
    color: #2c3e50;
}

.submission-date {
    color: #666;
    font-size: 0.9rem;
}

.submission-details p {
    margin: 0.5rem 0;
}

.submission-message {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 5px;
}

/* Utility Classes */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading-container {
    text-align: center;
    padding: 2rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    border: 1px solid #c3e6cb;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

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

.btn-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-link:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .adsense-header,
    .adsense-content-top,
    .adsense-footer {
        text-align: center;
    }
    
    .adsense-placeholder {
        padding: 10px;
        font-size: 14px;
    }
    
    .contact-form-section {
        padding: 1rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .submission-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .submission-date {
        font-size: 0.8rem;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .tab-content {
        flex-direction: column;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .data-management-grid {
        grid-template-columns: 1fr;
    }
    
    .pincodes-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
}

@media (max-width: 480px) {
    .adsense-placeholder {
        padding: 5px;
        font-size: 12px;
    }
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .states-grid-full {
        grid-template-columns: 1fr;
    }
}

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

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}