/* ========================
   HALAL FINDER - MAIN STYLES
   ======================== */

:root {
    --halal-primary: #004a31;
    --halal-primary-light: #006b47;
    --halal-primary-dark: #003020;
    --halal-secondary: #f39c12;
    --halal-success: #27ae60;
    --halal-danger: #e74c3c;
    --halal-warning: #f39c12;
    --halal-info: #3498db;
    --halal-text: #333;
    --halal-text-light: #666;
    --halal-border: #e0e0e0;
    --halal-bg: #f5f5f5;
}

* {
    box-sizing: border-box;
}

/* ========================
   FORM STYLES
   ======================== */

.halal-request-form-wrapper {
    padding: 30px 0;
}

#halal-popup{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
     -webkit-backdrop-filter: blur(4px);
}

#halal-popup.active{
    display: flex;
}

.halal-popup-content{
    background: #fff;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#halal-popup-close{
    position: absolute;
    right: 15px;
    top: 10px;

    width: 25px;
    height: 25px;
padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    border: none;
    background: var(--halal-primary);
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

/* Scrollbar width */
.halal-popup-content::-webkit-scrollbar {
    width: 4px;
}

/* Scrollbar track */
.halal-popup-content::-webkit-scrollbar-track {
    background: transparent;
}

/* Scrollbar handle */
.halal-popup-content::-webkit-scrollbar-thumb {
    background: var(--halal-primary);
    border-radius: 4px;
}

/* Scrollbar handle on hover */
.halal-popup-content::-webkit-scrollbar-thumb:hover {
    background: var(--halal-primary);
}

.halal-request-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;    
}

.halal-request-form-container h2 {
    color: var(--halal-primary);
    margin-bottom: 10px;
    font-size: 28px;
}

.halal-subtitle {
    color: var(--halal-text-light);
    margin-bottom: 30px;
    font-size: 14px;
}

.halal-form {
    width: 100%;
}

.halal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.halal-form-row:last-child {
    margin-bottom: 0;
}

.halal-form-group {
    display: flex;
    flex-direction: column;
}

.halal-form-group:not(.halal-form-row > .halal-form-group) {
    margin-bottom: 20px;
}

.halal-form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--halal-text);
    font-weight: 600;
    font-size: 14px;
}

.halal-form-group input,
.halal-form-group textarea,
.halal-form-group select {
    padding: 12px;
    border: 1px solid var(--halal-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.halal-form-group input:focus,
.halal-form-group textarea:focus,
.halal-form-group select:focus {
    outline: none;
    border-color: var(--halal-primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 49, 0.1);
}

.halal-form-group textarea {
    resize: vertical;
}

.halal-location-input {
    margin: 30px 0;
    padding: 20px;
    background: var(--halal-bg);
    border-radius: 6px;
}

.halal-location-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.halal-location-buttons button {
    flex: 1;
    min-width: 150px;
}

.halal-location-map {
    width: 100%;
    height: 400px;
    border-radius: 6px;
    margin: 20px 0;
    border: 2px solid var(--halal-primary);
}

.halal-search-results {
    background: white;
    border: 1px solid var(--halal-border);
    border-radius: 4px;
    margin: 10px 0;
    max-height: 300px;
    overflow-y: auto;
}

.halal-search-results ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.halal-search-results li {
    padding: 10px;
    border-bottom: 1px solid var(--halal-border);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.halal-search-results li:hover {
    background-color: var(--halal-bg);
}

.halal-search-results li:last-child {
    border-bottom: none;
}

/* ========================
   BUTTONS
   ======================== */

.halal-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

.halal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.halal-btn-primary {
    background-color: var(--halal-primary);
    color: white;
}

.halal-btn-primary:hover {
    background-color: var(--halal-primary-light);
    color: white;
}

.halal-btn-secondary {
    background-color: var(--halal-secondary);
    color: white;
}

.halal-btn-secondary:hover {
    background-color: #d68910;
    color: white;
}

.halal-btn-success {
    background-color: var(--halal-success);
    color: white;
}

.halal-btn-danger {
    background-color: var(--halal-danger);
    color: white;
}

.halal-btn-map {
    display: inline-block;
    background-color: var(--halal-info);
    color: white;
    padding: 10px 16px;
    font-size: 13px;
}

.halal-btn-map:hover {
    background-color: #2980b9;
    color: white;
}

.halal-form-message {
    padding: 15px;
    margin: 15px 0 0 0;
    border-radius: 4px;
    font-size: 14px;
}

.halal-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.halal-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================
   LOCATIONS LIST
   ======================== */

.halal-locations-wrapper {
    padding: 30px 0;
}

.halal-locations-container {
    max-width: 1200px;
    margin: 0 auto;
}

.halal-locations-container h2 {
    color: var(--halal-primary);
    margin-bottom: 30px;
    font-size: 28px;
}

.halal-locations-search {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.halal-search-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--halal-border);
    border-radius: 4px;
    font-size: 14px;
    min-width: 0;
}

.halal-locations-count {
    margin-bottom: 20px;
    color: var(--halal-text-light);
    font-size: 14px;
}

.halal-locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.halal-location-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    border: 1px solid var(--halal-border);
    transition: all 0.3s ease;
}

.halal-location-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.halal-location-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--halal-primary);
    padding-bottom: 15px;
}

.halal-location-header h3 {
    color: var(--halal-primary);
    margin: 0;
    flex: 1;
}

.halal-location-category {
    background-color: var(--halal-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 10px;
}

.halal-location-description {
    color: var(--halal-text-light);
    font-size: 13px;
    margin: 15px 0;
    line-height: 1.5;
}

.halal-location-details {
    margin: 15px 0;
}

.halal-location-details p {
    margin: 10px 0;
    font-size: 13px;
    color: var(--halal-text);
}

.halal-location-details a {
    color: var(--halal-primary);
    text-decoration: none;
}

.halal-location-details a:hover {
    text-decoration: underline;
}

.halal-icon {
    margin-right: 8px;
}

.halal-location-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--halal-border);
    display: flex;
    gap: 10px;
}

.halal-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--halal-text-light);
    grid-column: 1 / -1;
    font-size: 16px;
}

/* ========================
   MAP STYLES
   ======================== */

.halal-map-wrapper {
    padding: 30px 0;
}

.halal-map-container {
    max-width: 1200px;
    margin: 0 auto;
}

.halal-map-container h2 {
    color: var(--halal-primary);
    margin-bottom: 10px;
    font-size: 28px;
}

.halal-map-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.halal-radius-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.halal-radius-control label {
    font-weight: 600;
    color: var(--halal-text);
    white-space: nowrap;
}

.halal-radius-control input[type="range"] {
    width: 150px;
}

.halal-radius-control span {
    font-weight: 600;
    color: var(--halal-primary);
    min-width: 40px;
}

.halal-map-canvas {
    background: #f0f0f0;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.halal-map-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.halal-nearby-count {
    color: var(--halal-text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.halal-nearby-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.halal-nearby-item {
    padding: 15px;
    background: var(--halal-bg);
    border-left: 4px solid var(--halal-primary);
    border-radius: 4px;
}

.halal-nearby-item h4 {
    color: var(--halal-primary);
    margin: 0 0 8px 0;
    font-size: 14px;
}

.halal-nearby-item p {
    margin: 4px 0;
    font-size: 12px;
    color: var(--halal-text-light);
}

/* ========================
   ADMIN STYLES
   ======================== */

.halal-admin-wrap {
    margin-top: 20px;
}

.halal-admin-wrap h1 {
    color: var(--halal-primary);
    border-bottom: 3px solid var(--halal-primary);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.halal-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.halal-dashboard-card {
    background: white;
    border: 2px solid var(--halal-primary);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.halal-dashboard-card h3 {
    color: var(--halal-primary);
    margin: 0 0 15px 0;
}

.halal-dashboard-number {
    font-size: 42px;
    font-weight: bold;
    color: var(--halal-primary);
    margin: 15px 0;
}

.halal-dashboard-card p {
    margin: 10px 0 0 0;
}

.halal-dashboard-card a {
    color: var(--halal-primary);
    text-decoration: none;
    font-weight: 600;
}

.halal-status-tabs {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--halal-border);
}

.nav-tab {
    color: var(--halal-text);
    text-decoration: none;
    padding: 10px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-tab:hover {
    color: var(--halal-primary);
    border-bottom-color: var(--halal-secondary);
}

.nav-tab-active {
    color: var(--halal-primary);
    border-bottom-color: var(--halal-primary);
    font-weight: 600;
}

.halal-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.halal-status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.halal-status-approved {
    background-color: #d4edda;
    color: #155724;
}

.halal-status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.halal-request-detail {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.halal-detail-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--halal-border);
}

.halal-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.halal-detail-section h3 {
    color: var(--halal-primary);
    margin-bottom: 20px;
}

.halal-detail-section p {
    margin: 10px 0;
    line-height: 1.6;
}

.halal-admin-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.halal-rejection-form {
    background: var(--halal-bg);
    padding: 20px;
    border-radius: 6px;
}

.halal-rejection-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--halal-text);
}

.halal-rejection-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--halal-border);
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: inherit;
}

.halal-admin-form {
    background: white;
    padding: 0;
}

.halal-admin-form .form-table {
    width: 100%;
    border-collapse: collapse;
}

.halal-admin-form .form-table th {
    text-align: left;
    padding: 15px;
    background: var(--halal-bg);
    border: 1px solid var(--halal-border);
    color: var(--halal-text);
    font-weight: 600;
}

.halal-admin-form .form-table td {
    padding: 15px;
    border: 1px solid var(--halal-border);
}

.halal-admin-form input[type="text"],
.halal-admin-form input[type="email"],
.halal-admin-form input[type="tel"],
.halal-admin-form input[type="url"],
.halal-admin-form input[type="number"],
.halal-admin-form textarea,
.halal-admin-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--halal-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.halal-admin-form textarea {
    resize: vertical;
}

.halal-admin-map {
    border: 2px solid var(--halal-border);
    border-radius: 6px;
}

/* ========================
   RESPONSIVE STYLES
   ======================== */

@media (max-width: 768px) {
    .halal-form-row {
        grid-template-columns: 1fr;
    }

    .halal-location-buttons {
        flex-direction: column;
    }

    .halal-location-buttons button {
        width: 100%;
    }

    .halal-locations-grid {
        grid-template-columns: 1fr;
    }

    .halal-map-canvas {
        height: 400px !important;
    }

    .halal-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .halal-map-controls {
        flex-direction: column;
    }

    .halal-radius-control {
        width: 100%;
        flex-wrap: wrap;
    }

    .halal-locations-search {
        flex-direction: column;
    }

    .halal-location-header {
        flex-direction: column;
    }

    .halal-location-category {
        margin-left: 0;
        margin-top: 10px;
    }

    .halal-request-form-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .halal-location-card {
        padding: 15px;
    }

    .halal-request-form-container h2,
    .halal-locations-container h2,
    .halal-map-container h2 {
        font-size: 22px;
    }

    .halal-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .halal-locations-grid {
        grid-template-columns: 1fr;
    }
}

/* Leaflet overrides */
.leaflet-container {
    background: #e0e0e0;
    border-radius: 8px;
}

.leaflet-control-zoom {
    border: 2px solid var(--halal-primary) !important;
}

.leaflet-control-zoom a {
    color: var(--halal-primary) !important;
}

.leaflet-marker-icon {
    filter: hue-rotate(200deg) saturate(1.5);
}
