/* Reset & Base */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #f8f9fa;
    --text-color: #1f2937; /* Gray 900 */
    --link-color: #4F46E5; /* Indigo 600 */
    --border-color: #e5e7eb; /* Gray 200 */
    --card-bg: #ffffff;
    --text-muted: #6b7280; /* Gray 500 */
    --spacing: 16px;
    --emergency-color: #ef4444; /* Red 500 */
    --whatsapp-color: #22c55e; /* Green 500 */
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-main: 'Outfit', sans-serif;
}

.provider-name {
    font-family: var(--font-main);
    font-size: 1.15rem;
    font-weight: 600;
    color: #111827; /* Gray 900 */
    line-height: 1.2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #e0f2fe 0%, #d1fae5 100%); /* Light blue to light green */
    color: var(--text-color);
    line-height: 1.5;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh; /* Ensure gradient covers full viewport */
}

a {
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.2s;
}

/* Navigation Menu */
nav a:hover {
    color: #4338CA; /* Darker indigo on hover */
    text-decoration: underline;
}

.container {
    max-width: 1200px; /* Increased to fit 6 columns */
    margin: 0 auto;
    padding: 12px;
}

/* ... existing code ... */

@media (min-width: 900px) { /* Desktop */
    .category-list {
        grid-template-columns: repeat(6, 1fr); /* 6 columns as requested */
    }
}

@media (min-width: 600px) and (max-width: 899px) { /* Tablet */
    .category-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Header */
/* Header */
header {
    margin-bottom: 24px;
    border-bottom: none; /* Removed heavy border */
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
}

h1 {
    font-family: var(--font-main);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 a {
    color: var(--text-color);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Search */
.search-box-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.search-box {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    font-family: var(--font-main);
    border: 1px solid transparent;
    border-radius: var(--radius-lg) !important;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    color: var(--text-color);
}

.search-box:focus {
    outline: none;
    box-shadow: var(--shadow-lg);
    border-color: var(--link-color);
}

.search-box::placeholder {
    color: #9ca3af;
}

/* Contribute Button */
.contribute-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
    color: white;
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

.contribute-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #4338CA 0%, #4F46E5 100%);
}

.contribute-btn:active {
    transform: translateY(0);
}

/* Categories Grid - 2 Columns on Mobile for better stretch and size */
/* Categories Grid */
.category-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* Force equal widths */
    grid-auto-rows: 120px; /* Fixed height for uniformity */
    gap: 16px;
}

.category-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid transparent;
    color: var(--text-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    width: 100%;
    min-width: 0; /* Allow grid to control width */
    box-sizing: border-box; /* Include padding in width */
    overflow: hidden;
}

@media (hover: hover) {
    .category-list a:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: rgba(79, 70, 229, 0.1);
    }

    .category-list a:hover .cat-icon {
        transform: scale(1.1);
    }
}

.category-list a:active {
    transform: scale(0.98);
    background: #f9fafb;
}

.cat-icon {
    font-size: 2.2rem; /* Optimized size */
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.cat-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    width: 100%;
    padding: 0 4px;
}

.cat-name-en {
    font-weight: 600;
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.cat-name-gu {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

@media (min-width: 900px) {
    .category-list {
        grid-template-columns: repeat(6, minmax(0, 1fr)); /* Force equal widths */
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .category-list {
        grid-template-columns: repeat(4, minmax(0, 1fr)); /* Force equal widths */
    }
}

/* Provider List */
.provider-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 column */
    gap: 16px;
    grid-auto-rows: 1fr; /* Equal row heights */
    margin-top: 24px; /* Space from search box */
}

@media (min-width: 600px) {
    .provider-list {
        grid-template-columns: repeat(2, 1fr); /* Tablet: 2 equal columns */
    }
}

@media (min-width: 900px) {
    .provider-list {
        grid-template-columns: repeat(3, 1fr); /* Desktop: 3 equal columns */
    }
}

.provider-card {
    background: var(--card-bg);
    border: 1px solid transparent;
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    min-height: 140px; /* Enforce minimum height */
    height: 100%; /* Fill grid cell */
}

.provider-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Top Row */
.provider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.provider-name {
    font-family: var(--font-main);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    line-clamp: 2; /* Standard property for compatibility */
    -webkit-box-orient: vertical;
}

.provider-area {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 999px;
}

/* Actions */
.provider-actions {
    display: flex;
    gap: 6px; /* Reduced gap for 3 buttons */
    margin-top: 8px;
}

.action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px; /* Reduced padding */
    border-radius: var(--radius-md);
    font-size: 0.85rem; /* Smaller font */
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-call {
    background: var(--link-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    font-size: 0.75rem; /* Smaller font for phone numbers */
    white-space: nowrap; /* Prevent wrapping */
}

.btn-call:hover {
    background: #4338ca; /* darker indigo */
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

.btn-call:active {
    transform: translateY(0);
}

.btn-whatsapp {
    background-color: var(--whatsapp-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.2);
}

.btn-whatsapp:hover {
    background-color: #16a34a; /* darker green */
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(34, 197, 94, 0.3);
}

.btn-whatsapp:active {
    transform: translateY(0);
}

.btn-webpage {
    background-color: #22c55e; /* Parrot Green */
    color: white;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.2);
}

.btn-webpage:hover {
    background-color: #16a34a; /* Darker Green */
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(34, 197, 94, 0.3);
}

.btn-webpage:active {
    transform: translateY(0);
}

.btn-disabled {
    background-color: #e5e7eb; /* Gray 200 */
    color: #9ca3af; /* Gray 400 */
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn-disabled:hover {
    background-color: #e5e7eb;
    transform: none;
    box-shadow: none;
}

.tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.tag {
    font-size: 0.7rem;
    padding: 1px 5px;
    background: #f1f3f5;
    border-radius: 3px;
    color: #555;
    border: 1px solid #e9ecef;
}

.tag.emergency {
    background: #ffe3e3;
    color: var(--emergency-color);
    border-color: #ffc9c9;
}

/* Utility */
.back-link {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 20px 0;
}

/* Footer */
footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}
