/* ========================================
   RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #F8F9FA;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #212529;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

html {
    overscroll-behavior: none;
}

#app {
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   UTILITY CLASSES (Bootstrap-like)
======================================== */
.container {
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
    margin-right: auto;
    margin-left: auto;
    background-color: #F9FAFA;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
    margin-left: -12px;
    margin-top: -15px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 12px;
}

.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 12px;
}

.col-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
    padding: 0 12px;
}

.col-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
    padding: 0 12px;
}

.col-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 12px;
}

.d-flex {
    display: flex;
}

.d-none {
    display: none;
}

.flex-grow-1 {
    flex-grow: 1;
}

.flex-column {
    flex-direction: column;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 16px;
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

button.btn.btn-dark.p-3.rounded-3 span.icon-camera {
    border: 0px solid black;
    /*+border-radius: 0;*/
    -moz-border-radius: 0;
    -webkit-border-radius: 0;
    -khtml-border-radius: 0;
    border-radius: 0;
}

.mb-3 {
    margin-bottom: 16px;
}

.me-2 {
    margin-right: 8px;
}

.me-3 {
    margin-right: 16px;
}

.ms-2 {
    margin-left: 8px;
}

.p-0 {
    padding: 0;
}

.p-3 {
    padding: 16px;
}

.px-1 {
    padding-left: 4px;
    padding-right: 4px;
}

.px-3 {
    padding-left: 16px;
    padding-right: 16px;
}

.px-4 {
    padding-left: 24px;
    padding-right: 24px;
}

.py-2 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.py-5 {
    padding-top: 48px;
    padding-bottom: 48px;
}

.g-2 > * {
    padding: 4px;
}

.text-center {
    text-align: center;
}

.text-dark {
    color: #212529;
}

.text-muted {
    color: #6C757D;
}

.text-primary {
    color: #0D6EFD;
}

.text-danger {
    color: #DC3545;
}

.small {
    font-size: 0.875rem;
}

.fw-bold {
    font-weight: 700;
}

.w-100 {
    width: 100%;
}

.bg-white {
    background-color: #FFF;
}

.bg-light {
    background-color: #F8F9FA;
}

.bg-transparent {
    background-color: transparent;
}

.border {
    border: 1px solid #DEE2E6;
}

.border-0 {
    border: 0;
}

.border-start-0 {
    border-left: 0;
}

.border-end-0 {
    border-right: 0;
}

.rounded {
    border-radius: 4px;
}

.rounded-3 {
    border-radius: 8px;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ========================================
   NAVBAR
======================================== */
.navbar-custom {
    background: #1A5928;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-custom h6 {
    font-size: 1rem;
    font-weight: 600;
}

.icon-mosque {
    margin-right: 8px;
}

/* ========================================
   LOGIN BANNER
======================================== */
.login-banner {
    background: #FFC107;
    color: #333;
    text-align: center;
    padding: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========================================
   SEARCH BOX
======================================== */
.search-box {
    position: sticky;
    top: 56px;
    z-index: 998;
    background: #FFFFFF;
    padding: 6px 0;
    margin-top: 0;
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 6px 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.875rem;
}

.btn-light {
    background-color: #F8F9FA;
    border-color: #F8F9FA;
    color: #212529;
}

.btn-light:hover {
    background-color: #E2E6EA;
    border-color: #DAE0E5;
}

.btn-success {
    background-color: #1A5928;
    border-color: #1A5928;
    color: white;
}

.btn-success:hover {
    background-color: #144020;
    border-color: #144020;
}

.btn-danger {
    background-color: #DC3545;
    border-color: #DC3545;
    color: white;
}

.btn-danger:hover {
    background-color: #C82333;
    border-color: #BD2130;
}

.btn-dark {
    background-color: #343A40;
    border-color: #343A40;
    color: white;
}

.btn-dark:hover {
    background-color: #23272B;
    border-color: #1D2124;
}

.btn-outline-light {
    color: white;
    border-color: white;
    background-color: transparent;
}

.btn-outline-light:hover {
    background-color: white;
    color: #1A5928;
}

.btn-add {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: #1A5928;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 24px;
    cursor: pointer;
}

.btn-add:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    background: #144020;
}

.btn-close {
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 0.75;
}

/* ========================================
   CARDS
======================================== */
.card {
    background-color: white;
    border-radius: 4px;
    margin-bottom: 16px;
    padding-top: 4px;
    padding-bottom: 5px;
}

.card-inventory {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
    transition: transform 0.2s;
    background: white;
}

.card-inventory:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   FORMS
======================================== */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #FFF;
    background-clip: padding-box;
    border: 1px solid #CED4DA;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    color: #212529;
    background-color: #FFF;
    border-color: #1A5928;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(26, 89, 40, 0.25);
}

.form-control:disabled {
    background-color: #E9ECEF;
    opacity: 1;
}

.form-label {
    display: inline-block;
    margin-bottom: 4px;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    text-align: center;
    white-space: nowrap;
    background-color: #E9ECEF;
    border: 1px solid #CED4DA;
    border-radius: 4px;
}

.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

/* ========================================
   IMAGES
======================================== */
.thumb-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.thumb-img:hover {
    transform: scale(1.05);
}

.img-thumbnail {
    padding: 4px;
    background-color: #FFF;
    border: 1px solid #DEE2E6;
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* ========================================
   BADGES
======================================== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 4px;
}

.badge-lokasi {
    background: #E3F2FD;
    color: #1976D2;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ========================================
   ICONS
======================================== */
.icon-search,
.icon-location,
.icon-plus,
.icon-camera,
.icon-mosque {
    display: inline-block;
}

span.icon-camera {
    background-color: #FFFFFF;
}

.rounded-3 span.icon-camera {
    border: 0px solid #FFFFFF;
}

.icon-empty {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ========================================
   MODAL
======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
}

.modal.fade {
    transition: opacity 0.15s linear;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 16px;
    pointer-events: none;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 32px);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #FFF;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    outline: 0;
    overflow: scroll;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #DEE2E6;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-title {
    margin: 0;
    line-height: 1.5;
    font-size: 1.25rem;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 16px;
    overflow: ;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 12px;
    border-top: 1px solid #DEE2E6;
    border-bottom-right-radius: 8px;
    border-bottom-left-radius: 8px;
    gap: 8px;
}

.modal-lg {
    max-width: 800px;
}

.full-img-modal {
    background: rgba(0, 0, 0, 0.9) !important;
}

.full-img-modal .modal-dialog {
    max-width: 90%;
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 30px auto;
    }
    
    .modal-dialog-centered {
        min-height: calc(100% - 60px);
    }
    
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Mobile specific */
@media (max-width: 576px) {
    .thumb-img {
        width: 71px;
        height: 70px;
        margin-left: -17px;
    }
    
    .card-inventory {
        margin-bottom: 8px;
    }
    
    .btn-add {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }
    
    .modal-fullscreen-sm-down {
        max-width: 100%;
        margin: 0;
        height: 100%;
    }
    
    .modal-fullscreen-sm-down .modal-content {
        height: 100%;
        border: 0;
        border-radius: 0;
    }
}

/* ========================================
   ADDITIONAL UTILITIES
======================================== */
select {
    word-wrap: normal;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
}

button:not(:disabled),
[type="button"]:not(:disabled),
[type="reset"]:not(:disabled),
[type="submit"]:not(:disabled) {
    cursor: pointer;
}

input[type="file"] {
    overflow: hidden;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    height: auto;
}
