/* Reset & Base */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --link-color: #0066cc;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --text-muted: #6c757d;
    --spacing: 16px;
    --emergency-color: #dc3545;
    --whatsapp-color: #25d366;
}

/* ... existing code ... */

.provider-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem; /* Increased size */
    font-weight: 600;
    color: #000;
    line-height: 1.2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    font-size: 15px; /* Slightly smaller for compactness */
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--link-color);
}

.container {
    max-width: 800px; /* Increased for grid */
    margin: 0 auto;
    padding: 12px;
}

/* Header */
header {
    margin-bottom: 12px;
    border-bottom: 2px solid var(--text-color);
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem; /* Increased from 1.3rem (approx double) */
    font-weight: 700;
    line-height: 1.2;
}

h1 a {
    color: var(--text-color);
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Search */
.search-box {
    width: 100%;
    padding: 10px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 12px;
    background: var(--card-bg);
}

/* Categories Grid - 2 Columns on Mobile for better stretch and size */
.category-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Changed from 3 to 2 */
    grid-auto-rows: 110px; /* Force every row to be exactly 110px tall */
    gap: 8px;
}

.category-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 10px 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    transition: transform 0.1s, background 0.2s;
    height: 110px; /* Fixed height instead of min-height to ensure strict uniformity */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent content from stretching the box */
}

/* ... existing active state ... */
.category-list a:active {
    transform: scale(0.96);
    background: #e9ecef;
}

.cat-icon {
    font-size: 1.8rem;
    margin-bottom: 2px;
}

.cat-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.cat-name-en {
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem; /* Decreased 1 point (0.9rem -> 0.8rem) */
    color: #333;
}

.cat-name-gu {
    font-size: 0.7rem; /* Decreased 1 point (0.8rem -> 0.7rem) */
    color: var(--text-muted);
    font-weight: 400;
}

@media (min-width: 600px) {
    .category-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Provider List - Grid Layout */
.provider-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr; /* Default mobile 1 col, but compact */
    gap: 10px;
}

/* 2-Column Grid on Mobile/Tablet */
@media (min-width: 350px) {
    .provider-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

.provider-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Top Row: Name and Area */
.provider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.provider-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #000;
    line-height: 1.2;
}

.provider-area {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

/* Actions Row: Phone & WhatsApp */
.provider-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-call {
    background: #0066cc;
    color: white;
    border: 2px solid #0066cc;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.btn-call:hover {
    background: #0052a3;
    border-color: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.btn-call:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 102, 204, 0.2);
}

/* Make the phone icon white to match button */
.phone-icon {
    color: white;
    margin-right: 6px;
    font-style: normal;
}

.btn-whatsapp {
    background-color: var(--whatsapp-color);
    color: white;
    border: 2px solid var(--whatsapp-color);
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp:hover {
    background-color: #20ba5a;
    border-color: #20ba5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(37, 211, 102, 0.2);
}

.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;
}
