/* Responsive Adjustments */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        padding: 10px 5%;
    }
    .contact-info-footer li {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: #666;
}
.about-text h3 {
  font-size: 20px;
  color: var(--text-color);
  margin-bottom: 20px;
  font-weight: 700;
}
    
    .contact-info {
        margin-top: 10px;
        width: 100%;
        justify-content: space-around;
    }
    
    .contact-info div {
        margin-left: 0;
        font-size: 14px;
    }
    
    
    .search-input {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .map-container {
        height: 300px;
    }
    .modal-content {
        margin: 15% auto;
        width: 95%;
        padding: 20px;
    }
    
    .value-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-documents {
        margin-top: 15px;
    }
    .services-section {
        padding: 40px 0;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .section-header p {
        font-size: 16px;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .service-card {
        padding: 20px;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-icon i {
        font-size: 24px;
    }
    
    .service-card h3 {
        font-size: 16px;
    }
    
    .service-card p {
        font-size: 14px;
    }
    .description h2 {
        font-size: 32px;
    }
    
    .description p {
        font-size: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .calculator-info{
        display: none;
    }

    .contact-info {
        
        align-items: flex-start;
    }
    
    .contact-info div {
        margin-bottom: 5px;
    }
    
    
    .main-container {
        margin-top: 80px;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        max-width: 100%;
    }
    .description h2 {
        font-size: 22px;
    }
    
    .description p {
        font-size: 14px;
    }
    .main-container{
        min-height: calc(40vh);
    }
    #formContainer h2{
        font-size: 20px;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .footer-column {
        flex: 0 0 45%;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 40px 0 20px;
    }
    
    .social-links {
        margin-top: 10px;
        justify-content: center;
    }
}

@media (max-width: 375px) {
  .services-grid.three-cards {
    gap: 4px;
  }
  
  .service-card {
    padding: 8px 5px;
  }
  
  .service-card h3 {
    font-size: 8px;
    margin-bottom: 2px;
  }
  
  .service-card p {
    font-size: 9px;
    line-height: 1.2;
  }
  
  .service-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
  }
  
  .service-icon i {
    font-size: 14px;
  }
  
  /* Reduce section padding on very small devices */
  .services-section {
    padding: 15px 0;
  }
  
  .section-header {
    margin-bottom: 15px;
  }
  
  .section-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
  }
}

 .mobile-documents-gallery {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #f8f9fa;
            z-index: 2500;
            overflow-y: auto;
            padding: 0px 0 80px 0; /* Bottom padding for mobile nav */
        }

        .mobile-documents-gallery.active {
            display: block;
            animation: slideInFromBottom 0.4s ease-out;
        }

        .mobile-gallery-header {
            background-color: var(--primary-color, #0041f5);
            color: white;
            padding: 15px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 10;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .mobile-gallery-title {
            font-size: 18px;
            font-weight: 600;
            margin: 0;
        }

        .close-mobile-gallery {
            background: transparent;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.3s ease;
        }

        .close-mobile-gallery:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .gallery-subtitle {
            text-align: center;
            padding: 20px;
            color: #666;
            font-size: 14px;
            line-height: 1.5;
        }

        .documents-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            padding: 0 15px 20px 15px;
        }

        .document-card {
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            height: 250px;
        }

        .document-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
        }

        .document-card-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            opacity: 0.3;
        }

        .document-card-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(0, 65, 245, 0.8) 0%, rgba(0, 65, 245, 0.6) 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 20px;
            text-align: center;
        }

        .document-icon {
            color: white;
            font-size: 32px;
            margin-bottom: 10px;
        }

        .document-title {
            color: white;
            font-size: 18px;
            font-weight: 600;
            margin: 0 0 5px 0;
        }

        .document-subtitle {
            color: rgba(255, 255, 255, 0.9);
            font-size: 12px;
            margin: 0 0 10px 0;
        }

        .document-description {
            color: rgba(255, 255, 255, 0.8);
            font-size: 11px;
            line-height: 1.3;
            margin: 0;
        }

        .view-document-btn {
            position: absolute;
            bottom: 10px;
            right: 15px;
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 12px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 500;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .view-document-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
        }

        /* Full Image Viewer */
        .image-viewer-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.95);
            z-index: 3000;
            align-items: center;
            justify-content: center;
        }

        .image-viewer-modal.active {
            display: flex;
            animation: fadeIn 0.3s ease;
        }

        .image-viewer-content {
            position: relative;
            max-width: 95%;
            max-height: 95%;
            display: flex;
            flex-direction: column;
        }

        .image-viewer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background-color: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 10px 10px 0 0;
        }

        .image-viewer-title {
            color: white;
            font-size: 16px;
            font-weight: 600;
            margin: 0;
        }

        .close-image-viewer {
            background: transparent;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.3s ease;
        }

        .close-image-viewer:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .document-image {
            width: 100%;
            height: auto;
            max-height: 80vh;
            object-fit: contain;
            border-radius: 0 0 10px 10px;
        }

        .image-actions {
            display: flex;
            justify-content: center;
            gap: 15px;
            padding: 15px;
            background-color: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 0 0 10px 10px;
        }

        .image-action-btn {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 10px 16px;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .image-action-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
        }

        /* Sample document background images - Replace these URLs with actual document images */
        .doc-ec { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="400" viewBox="0 0 300 400"><rect width="300" height="400" fill="%23f0f8ff"/><text x="150" y="50" text-anchor="middle" font-family="Arial" font-size="16" font-weight="bold" fill="%23333">ENCUMBRANCE CERTIFICATE</text><text x="20" y="100" font-family="Arial" font-size="12" fill="%23666">Document No: EC/2024/001</text></svg>'); }
        
        .doc-katha { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="400" viewBox="0 0 300 400"><rect width="300" height="400" fill="%23fff8f0"/><text x="150" y="50" text-anchor="middle" font-family="Arial" font-size="16" font-weight="bold" fill="%23333">KATHA EXTRACT</text><text x="20" y="100" font-family="Arial" font-size="12" fill="%23666">Katha No: 567/2024</text></svg>'); }
        
        .doc-rtc { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="400" viewBox="0 0 300 400"><rect width="300" height="400" fill="%23f0fff0"/><text x="150" y="50" text-anchor="middle" font-family="Arial" font-size="16" font-weight="bold" fill="%23333">RTC RECORD</text><text x="20" y="100" font-family="Arial" font-size="12" fill="%23666">Record of Rights, Tenancy and Crops</text></svg>'); }
        
        .doc-mutation { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="400" viewBox="0 0 300 400"><rect width="300" height="400" fill="%23fff0f8"/><text x="150" y="50" text-anchor="middle" font-family="Arial" font-size="16" font-weight="bold" fill="%23333">MUTATION RECORD</text><text x="20" y="100" font-family="Arial" font-size="12" fill="%23666">Mutation No: MUT/2024/789</text></svg>'); }
        
        .doc-survey { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="400" viewBox="0 0 300 400"><rect width="300" height="400" fill="%23f8f0ff"/><text x="150" y="50" text-anchor="middle" font-family="Arial" font-size="16" font-weight="bold" fill="%23333">SURVEY SKETCH</text><text x="20" y="100" font-family="Arial" font-size="12" fill="%23666">Survey Settlement No: SS-456</text></svg>'); }

        /* Animations */
        @keyframes slideInFromBottom {
            from {
                transform: translateY(100%);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* Show only on mobile */
        @media (min-width: 769px) {
            .mobile-documents-gallery {
                display: none !important;
            }
        }

        /* Small mobile adjustments */
        @media (max-width: 480px) {
            .document-card {
                height: 200px;
            }
            
            .document-title {
                font-size: 16px;
            }
            
            .document-icon {
                font-size: 28px;
            }
            
            .gallery-subtitle {
                padding: 15px;
                font-size: 13px;
            }
        }