/* MadiNi - Custom Styles Beyond Tailwind */

/* Outfit must win everywhere - including third-party widgets. */
*, button, input, select, textarea, table,
.dataTables_wrapper, .leaflet-popup-content-wrapper {
    font-family: 'Outfit', sans-serif !important;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Card lift - subtle, no colored shadow. */
.card-hover { transition: transform .15s ease, box-shadow .15s ease; }
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(15,17,21,0.06);
}

/* ─── Mineral Badge ────────────────────── */
.mineral-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

/* ─── Buttons ──────────────────────────── */
.btn-primary {
    background: #0F5132;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-primary:hover { background: #0B3D26; }

.btn-secondary {
    background: #1E90FF;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-secondary:hover { background: #1873CC; }

.btn-outline {
    border: 1px solid #0F5132;
    color: #0F5132;
    padding: 9px 22px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: #fff;
    cursor: pointer;
}
.btn-outline:hover { background: #0F5132; color: #fff; }

/* ─── Toast Notifications ──────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    margin-bottom: 10px;
    animation: slideIn 0.2s ease, fadeOut 0.3s ease 2.7s;
    box-shadow: 0 4px 16px rgba(15,17,21,0.08);
    max-width: 400px;
}
.toast-success { background: #0F5132; }
.toast-error,
.toast-danger   { background: #B91C1C; }
.toast-warning  { background: #B45309; }
.toast-info     { background: #1E90FF; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Loading spinner - deep green on hairline grey. */
.spinner {
    border: 2px solid #E5E7EB;
    border-top: 2px solid #0F5132;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─── Placeholder Images ───────────────── */
.placeholder-img {
    background: linear-gradient(135deg, var(--color-from, #0F5132), var(--color-to, #1E90FF));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}
.placeholder-img::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

/* ─── DataTables Overrides ─────────────── */
.dataTables_wrapper {
    font-family: 'Outfit', sans-serif !important;
}
table.dataTable {
    border-collapse: collapse !important;
    border-radius: 12px;
    overflow: hidden;
}
table.dataTable thead th {
    background: #F5F5F4 !important;
    color: #1C1917;
    font-weight: 600;
    border-bottom: 2px solid #E7E5E4 !important;
    padding: 14px 16px !important;
    white-space: nowrap;
}
table.dataTable tbody td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #F5F5F4 !important;
}
table.dataTable tbody tr:hover {
    background: #FAFAF9 !important;
}
.dataTables_filter input {
    border: 1px solid #D6D3D1 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    outline: none !important;
    font-family: 'Outfit', sans-serif !important;
}
.dataTables_filter input:focus {
    border-color: #0F5132 !important;
    box-shadow: 0 0 0 2px rgba(15,81,50, 0.1) !important;
}
.dataTables_length select {
    border: 1px solid #D6D3D1 !important;
    border-radius: 8px !important;
    padding: 4px 8px !important;
}
.dataTables_info {
    font-size: 14px;
    color: #78716C;
}
.dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    margin: 0 2px !important;
}
.dataTables_paginate .paginate_button.current {
    background: #0F5132 !important;
    color: white !important;
    border-color: #0F5132 !important;
}

/* ─── Leaflet Popup Override ───────────── */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    font-family: 'Outfit', sans-serif !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}
.leaflet-popup-content {
    margin: 14px 18px !important;
    font-size: 14px;
}

/* ─── Timeline Styles ──────────────────── */
.timeline-line {
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #E7E5E4;
}
.timeline-item {
    position: relative;
    padding-left: 60px;
    padding-bottom: 32px;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: 16px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px currentColor;
    z-index: 1;
}

/* ─── Scrollbar Styling ────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #D6D3D1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #A8A29E;
}

/* ─── Form Input Focus ─────────────────── */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #0F5132 !important;
    box-shadow: 0 0 0 3px rgba(15,81,50, 0.1) !important;
}

/* ─── Responsive Tweaks ────────────────── */
@media (max-width: 768px) {
    .placeholder-img {
        font-size: 32px;
    }
    .toast {
        max-width: calc(100vw - 40px);
        font-size: 14px;
    }
}
