/* Custom CSS for MyEarthInfo */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    padding-top: 76px;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(255,255,255,0.1)"><polygon points="0,0 1000,0 1000,100 0,80"/></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-insight {
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
}

.hero-metrics .metric-tile {
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 120px;
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.08);
}

.metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    font-weight: 600;
    opacity: 0.85;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Search Section */
.search-section {
    margin-top: -40px;
    position: relative;
    z-index: 3;
}

.search-section .card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-section .form-control,
.search-section .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.search-section .form-control:focus,
.search-section .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.search-section .btn-primary {
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
}

/* Toolkit Section */
.toolkit-section {
    background: #ffffff;
}

.tool-card {
    display: block;
    background: #f8f9ff;
    border-radius: 16px;
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(13, 110, 253, 0.08);
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 45px rgba(13, 110, 253, 0.15);
    border-color: rgba(13, 110, 253, 0.25);
}

.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.tool-card h5 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tool-card p {
    color: #6c757d;
    margin-bottom: 1rem;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
}

/* Results Section */
.results-section {
    background-color: #f8f9fa;
}

.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: translateY(-1px);
}

.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

/* Features Section */
.features-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.feature-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-card h4 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* IFSC Section */
.ifsc-section {
    background: linear-gradient(135deg, #141e30 0%, #243b55 100%);
}

.ifsc-card {
    border-radius: 18px;
}

.ifsc-card .input-group-text {
    border-radius: 12px 0 0 12px;
    background-color: rgba(13, 110, 253, 0.12);
    border: 2px solid rgba(13, 110, 253, 0.25);
    border-right: 0;
}

.ifsc-card .form-control {
    border-radius: 0 12px 12px 0;
    border: 2px solid rgba(13, 110, 253, 0.25);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.ifsc-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.ifsc-result {
    border-radius: 14px;
    background: rgba(13, 110, 253, 0.08);
    padding: 1.5rem;
    color: #0d1b2a;
    border: 1px solid rgba(13, 110, 253, 0.25);
}

.ifsc-result h5 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.ifsc-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.ifsc-meta .meta-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 0.9rem;
    border: 1px solid rgba(33, 37, 41, 0.1);
}

.ifsc-meta .meta-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

.ifsc-meta .meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

.ifsc-highlights {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 500;
}

.ifsc-highlights i {
    font-size: 1.2rem;
}

.ifsc-error {
    background: rgba(220, 53, 69, 0.12);
    color: #842029;
    border: 1px solid rgba(220, 53, 69, 0.25);
}

.ifsc-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    color: var(--primary-color);
}

.ifsc-loading .spinner-border {
    width: 1.2rem;
    height: 1.2rem;
}

/* Knowledge Section */
.knowledge-section {
    background: #f4f6fb;
}

.knowledge-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(13, 110, 253, 0.1);
}

.knowledge-card li {
    padding: 0.6rem 0;
    font-weight: 500;
    border-bottom: 1px solid rgba(33, 37, 41, 0.07);
}

.knowledge-card li:last-child {
    border-bottom: none;
}

.resource-card {
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #eef3ff 100%);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

footer h5,
footer h6 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

footer .text-muted {
    color: #bdc3c7 !important;
}

footer a.text-muted:hover {
    color: white !important;
    text-decoration: none !important;
}

.stat-item h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pincode Breakdown Styling */
.breakdown-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.breakdown-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.breakdown-card .card-body {
    padding: 1rem;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.breakdown-card h4 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.breakdown-card h6 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.breakdown-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Mobile Result Cards */
.result-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* Clickable Elements */
.clickable-row {
    transition: all 0.2s ease;
}

.clickable-row:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
    transform: translateY(-1px);
}

.clickable-card {
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.result-card .card-body {
    padding: 1.25rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.4;
    border-bottom: 1px solid #f8f9fa;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-item i {
    margin-top: 0.1rem;
    width: 20px;
    flex-shrink: 0;
}

.info-item strong {
    color: var(--dark-color);
    margin-right: 0.5rem;
}

.pincode-badge .badge {
    font-size: 1rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0 60px;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-insight {
        margin-top: 2rem;
    }

    .hero-metrics .metric-tile {
        min-height: 100px;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .ifsc-section {
        padding: 60px 0;
    }

    .ifsc-meta {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    .search-section {
        margin-top: -20px;
    }
    
    .search-section .card-body {
        padding: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .feature-card {
        margin-bottom: 2rem;
    }
    
    /* Mobile Pincode Breakdown Improvements */
    .breakdown-card {
        margin-bottom: 0.75rem;
    }
    
    .breakdown-card .card-body {
        padding: 1.25rem 1rem;
        min-height: 90px;
    }
    
    .breakdown-card h4 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .breakdown-card h6 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .breakdown-label {
        font-size: 0.8rem;
    }
    
    /* Mobile Result Cards */
    .result-card {
        margin-bottom: 1rem;
        border-radius: 10px;
    }
    
    .result-card .card-body {
        padding: 1rem;
    }
    
    .info-item {
        padding: 0.4rem 0;
        font-size: 0.9rem;
    }
    
    .pincode-badge .badge {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .search-section .btn-primary {
        width: 100%;
        margin-top: 1rem;
    }

    .tool-card {
        padding: 1.35rem;
    }

    .ifsc-meta {
        grid-template-columns: 1fr;
    }
    
    .stat-item h4 {
        font-size: 1.25rem;
    }
    
    /* Extra small mobile devices - Pincode Breakdown */
    .breakdown-card .card-body {
        padding: 1rem;
        min-height: 85px;
    }
    
    .breakdown-card h4 {
        font-size: 1.8rem;
    }
    
    .breakdown-card h6 {
        font-size: 1rem;
        text-align: center;
        line-height: 1.3;
    }
    
    .breakdown-label {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
    
    /* Make the zone info card more readable on very small screens */
    .breakdown-card.bg-info .card-body {
        padding: 1.25rem 1rem;
    }
    
    /* Extra small mobile result cards */
    .result-card .card-body {
        padding: 0.875rem;
    }
    
    .info-item {
        padding: 0.35rem 0;
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .info-item i {
        width: 18px;
        font-size: 0.85rem;
    }
    
    .pincode-badge .badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.7rem;
    }
    
    .result-card .btn-sm {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

/* Form Loading States */
.form-select:disabled {
    background-color: #f8f9fa;
    opacity: 0.7;
}

.form-select option:disabled {
    color: #6c757d;
    font-style: italic;
}

/* Loading spinner for selects */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Form help text styling */
.form-text {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Enhanced form styling */
.search-section .form-label {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.search-section .form-control:focus,
.search-section .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

/* State/District/Sub-district hierarchy styling */
.location-hierarchy {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.location-hierarchy .form-label {
    color: var(--primary-color);
    font-weight: 700;
}

/* Print Styles */
@media print {
    .navbar,
    .search-section,
    .features-section,
    footer {
        display: none !important;
    }
    
    .results-section {
        background: white !important;
    }
    
    .table {
        box-shadow: none !important;
    }
}

