/* Custom Styles for BorewellMart */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Hero Section */
.hero-section {
    background-size: cover;
    background-position: center;
}

/* Card Styles */
.city-card,
.service-card,
.vendor-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.city-card:hover,
.service-card:hover,
.vendor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Circular Images for Cities and Services - Smaller */
.city-card .card-img-top,
.service-card .card-img-top {
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    margin: 0.5rem auto !important;
    display: block !important;
    border: 2px solid #f8f9fa !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Card Body - Extra Small Size */
.city-card .card-body,
.service-card .card-body,
.vendor-card .card-body {
    padding: 0.5rem !important;
    text-align: center;
}

/* Card Title - Extra Small */
.city-card .card-title,
.service-card .card-title,
.vendor-card .card-title {
    font-size: 0.75rem !important;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Card Text - Extra Small */
.city-card .card-text,
.service-card .card-text,
.vendor-card .card-text {
    font-size: 0.7rem !important;
    margin-bottom: 0.25rem !important;
}

/* Buttons - Extra Small */
.city-card .btn,
.service-card .btn,
.vendor-card .btn {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
}

/* Badge Styles */
.badge-lg {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* Form Styles */
form input,
form select,
form textarea {
    border-radius: 8px;
}

/* Navbar */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.services-dropdown-menu {
    min-width: 260px;
    padding: 0.5rem 0;
    background-color: #212529;
    border-color: rgba(255, 255, 255, 0.15);
}

.services-dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.55rem 1rem;
    white-space: normal;
}

.services-dropdown-menu .dropdown-item:hover,
.services-dropdown-menu .dropdown-item:focus {
    color: #fff;
    background-color: rgba(13, 110, 253, 0.35);
}

.services-dropdown-menu .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.15);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Blog Content */
.blog-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        height: auto;
        padding: 100px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    /* Mobile logo adjustments */
    .navbar-brand img {
        max-height: 60px !important;
    }

    /* Mobile navbar */
    .navbar {
        height: auto !important;
        min-height: 60px;
    }

    /* Mobile spacing */
    section {
        padding: 2rem 0;
    }

    /* Mobile cards */
    .card {
        margin-bottom: 1rem;
    }

    /* Mobile tables */
    .table-responsive {
        font-size: 0.85rem;
    }

    /* Mobile forms */
    .form-control, .form-select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Mobile buttons */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .navbar-brand img {
        max-height: 80px !important;
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    /* Tablet adjustments */
    .container {
        max-width: 95%;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .navbar-brand img {
        max-height: 50px !important;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    /* Compact spacing for small phones */
    section {
        padding: 1.5rem 0;
    }
}

/* Table Styles */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
}

/* Button Styles */
.btn {
    border-radius: 8px;
}

/* Card Image */
.card-img-top {
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
}

/* Stats Cards */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info,
.card.bg-danger {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Breadcrumb */
.breadcrumb {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

/* Rating Stars */
.text-warning {
    color: #ffc107 !important;
}

/* Emergency Badge */
.badge.bg-danger {
    animation: pulse 2s infinite;
}

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

/* WhatsApp Button */
.btn-success {
    background-color: #25D366;
    border-color: #25D366;
}

.btn-success:hover {
    background-color: #128C7E;
    border-color: #128C7E;
}

/* Form Check */
.form-check-input {
    cursor: pointer;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Modal */
.modal-content {
    border-radius: 12px;
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
}

/* Search Bar */
.hero-section .card {
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Image Gallery */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item img {
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Dashboard Stats */
.dashboard-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.dashboard-stat h2 {
    font-size: 3rem;
    font-weight: bold;
}

/* Booking Status */
.booking-pending {
    background-color: #ffc107;
    color: #000;
}

.booking-accepted {
    background-color: #17a2b8;
    color: #fff;
}

.booking-in-progress {
    background-color: #007bff;
    color: #fff;
}

.booking-completed {
    background-color: #28a745;
    color: #fff;
}

.booking-cancelled {
    background-color: #dc3545;
    color: #fff;
}

/* Vendor Verification */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .table-responsive .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    .nav-link, .dropdown-item, .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Services Dropdown Menu Alignment */
.services-dropdown-menu {
    min-width: 280px;
    max-width: 320px;
}

.services-dropdown-menu .dropdown-item {
    padding: 0.6rem 1rem;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Global Content Alignment Fixes */
.container {
    max-width: 1200px;
}

/* Card Content Alignment */
.card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Section Spacing */
section {
    padding: 3rem 0;
}

/* Nested Dropdown Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    border-radius: 0.375rem;
    display: none;
    z-index: 1000;
    min-width: 280px;
    max-width: 320px;
}

.dropdown-submenu .dropdown-menu .dropdown-item {
    white-space: normal;
    word-wrap: break-word;
    padding: 0.6rem 1rem;
    line-height: 1.4;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

/* Show nested dropdown on hover for desktop */
@media (min-width: 992px) {
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
        position: absolute;
    }

    .dropdown-submenu > .dropdown-toggle:after {
        display: inline-block;
        margin-left: 0.255em;
        vertical-align: 0.255em;
        content: "";
        border-top: 0.3em solid;
        border-right: 0.3em solid transparent;
        border-bottom: 0;
        border-left: 0.3em solid transparent;
    }

    .dropdown-submenu > .dropdown-toggle:after {
        transform: rotate(-90deg);
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%) rotate(-90deg);
    }
}

/* Mobile nested dropdown adjustments */
@media (max-width: 991px) {
    .dropdown-submenu .dropdown-menu {
        position: static;
        display: none;
        margin-top: 0;
        margin-left: 0;
        background-color: #f8f9fa;
        padding-left: 20px;
    }

    .dropdown-submenu .dropdown-menu.show {
        display: block;
    }

    .dropdown-submenu > .dropdown-toggle:after {
        content: "▼";
        font-size: 10px;
        margin-left: 5px;
    }
}
