/* ===============================
   THEME VARIABLES
=============================== */
:root {
    --primary: #468D47;
    --primary-dark: #3b763c;
    --primary-light: #6fbf73;
    --primary-bg: #eef6ee;

    --text-dark: #2f5e30;
    --border-light: #d8f3dc;
    --shadow-primary: rgba(70, 141, 71, 0.15);
}

/* ===============================
   RESET & BASE
=============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.header-logo {
    width: 200px;
    max-width: 100%;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg,
            var(--primary) 0%,
            var(--primary-light) 100%);
    padding: 20px;
    min-height: 100vh;
}

/* ===============================
   LAYOUT
=============================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ===============================
   HEADER
=============================== */
.header {
    background: linear-gradient(135deg,
            var(--primary) 0%,
            var(--primary-dark) 100%);
    color: #ffffff;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header h1 .material-icons {
    font-size: 1.2em;
}

.header h2 {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header h2 .material-icons {
    font-size: 1.2em;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
}

/* ===============================
   SEARCH
=============================== */
.search-box {
    padding: 20px 30px;
    background: var(--primary-bg);
    border-bottom: 2px solid var(--border-light);
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 50px;
    border: 2px solid var(--primary-light);
    border-radius: 25px;
    font-size: 1em;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--shadow-primary);
}

/* ===============================
   TABLE
=============================== */
.table-container {
    padding: 30px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

thead {
    background: linear-gradient(135deg,
            var(--primary) 0%,
            var(--primary-dark) 100%);
    color: #ffffff;
}

th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 15px 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95em;
}

tbody tr {
    transition: all 0.3s;
}

tbody tr:hover {
    background: var(--primary-bg);
    transform: scale(1.01);
    box-shadow: 0 2px 8px var(--shadow-primary);
}

.no-column {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

/* ===============================
   CONTENT ELEMENTS
=============================== */
.store-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.store-name .material-icons {
    color: var(--primary);
}

.owner-cell {
    font-weight: 600;
    color: #495057;
}

.address-cell {
    max-width: 300px;
    line-height: 2;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.address-cell .material-icons {
    font-size: 18px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.phone-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.phone-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.product-badge {
    display: inline-block;
    background: #dff0e0;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    margin: 2px;
    font-weight: 500;
    border: 1px solid var(--primary-light);
}

.area-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.area-badge .material-icons {
    font-size: 16px;
}

/* ===============================
   FOOTER
=============================== */
.footer {
    background: var(--primary-bg);
    padding: 20px;
    text-align: center;
    color: var(--primary);
    border-top: 2px solid var(--border-light);
}

.footer .material-icons {
    vertical-align: middle;
    margin-right: 5px;
}

/* ===============================
   NO RESULT
=============================== */
.no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1em;
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.contact-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.contact-btn.phone {
    background: var(--primary);
}

.contact-btn.whatsapp {
    background: #25D366;
}

.contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.contact-number {
    font-weight: 500;
    color: var(--primary);
    font-size: 0.9em;
}

/* OWNER */
.owner-cell .material-icons {
    font-size: 16px;
    vertical-align: middle;
    color: var(--primary);
}

/* CONTACT */
.contact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.contact-number {
    font-weight: 500;
    color: var(--primary);
}

.contact-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: 0.2s;
}

.contact-btn.phone {
    background: var(--primary);
}

.contact-btn.whatsapp {
    background: #25D366;
}

.contact-btn:hover {
    transform: scale(1.1);
}

/* NO RESULT */
.no-results {
    display: none;
    text-align: center;
    padding: 40px;
    color: var(--primary);
}

.footer-main {
    margin-top: 40px;
    padding: 30px 20px 15px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    font-family: 'Poppins', sans-serif;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1100px;
    margin: auto;
}

.footer-col h4 {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.footer-col p,
.footer-col a {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    text-decoration: none;
}

.footer-col a:hover {
    color: #2e7d32;
}

.social-links a {
    display: block;
    margin-bottom: 8px;
}

.social-links i {
    margin-right: 6px;
}

.footer-bottom {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 13px;
    color: #666;
}

/* ===============================
   RESPONSIVE - MOBILE CARD LAYOUT
=============================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header-logo {
        width: 120px;
    }

    .header h2 {
        font-size: 1.5em;
        flex-direction: column;
        gap: 8px;
    }

    .header p {
        font-size: 0.95em;
    }

    .search-box {
        padding: 15px;
    }

    .table-container {
        padding: 15px;
        overflow-x: visible;
    }

    /* Hide table, show cards */
    table thead {
        display: none;
    }

    table,
    tbody,
    tr {
        display: block;
        width: 100%;
    }

    tbody tr {
        background: #ffffff;
        border: 2px solid var(--border-light);
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        position: relative;
    }

    tbody tr:hover {
        transform: none;
        box-shadow: 0 4px 12px var(--shadow-primary);
    }

    td {
        display: block;
        padding: 8px 0;
        border: none;
        text-align: left;
        position: relative;
    }

    /* Number badge - top right corner */
    td.no-column {
        position: absolute;
        top: 15px;
        right: 15px;
        background: var(--primary);
        color: white;
        width: 35px;
        height: 35px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 0.9em;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    /* Add labels before content */
    td:not(.no-column)::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary);
        display: block;
        margin-bottom: 5px;
        font-size: 0.85em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Province */
    td:nth-child(2)::before {
        content: "Provinsi";
    }

    /* Area */
    td:nth-child(3)::before {
        content: "Area";
    }

    /* Store name */
    td:nth-child(4)::before {
        content: "Nama Toko";
    }

    /* Address/Telp Admin */
    td:nth-child(5)::before {
        content: "Alamat";
    }

    /* Contact */
    td:nth-child(6)::before {
        content: "Kontak Admin";
    }

    /* Products */
    td:nth-child(7)::before {
        content: "Produk";
    }

    /* Styling adjustments for mobile */
    .store-name {
        font-size: 1.1em;
        margin-top: 5px;
    }

    .address-cell {
        max-width: 100%;
        line-height: 1.6;
    }

    .area-badge {
        display: inline-flex;
        font-size: 0.85em;
    }

    .product-badge {
        font-size: 0.8em;
        margin: 3px 3px 3px 0;
    }

    .contact-actions {
        flex-wrap: wrap;
    }

    .contact-number {
        font-size: 0.85em;
    }

    /* Footer adjustments */
    .footer {
        padding: 15px;
        font-size: 0.9em;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .footer-main {
        padding: 20px 15px 10px;
    }

    .footer-col h4 {
        font-size: 15px;
    }

    .footer-col p,
    .footer-col a {
        font-size: 13px;
    }

    .footer-bottom {
        font-size: 12px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .table-container {
        overflow-x: auto;
    }

    th,
    td {
        padding: 12px 10px;
        font-size: 0.9em;
    }

    .address-cell {
        max-width: 250px;
    }
}