/* www/condo/styles/global.css */

/* ================================================ */
/* SECTION 1: BASE, VARIABLES, SHARED STYLES        */
/* ================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Inter+Tight:wght@500;700&display=swap');

:root {
    --primary: #101034;
    --primary-dark: #3a2dbd;
    --secondary: #EDEDED;
    --background: #FFFFFF;
    --text: #333333;
    --primary-text: #14181B;
    --secondary-text: #57636C;
    --text-light: #FFFFFF;
    --accent: #1ABB9C;
    --warning: #f0ad4e;
    --danger: #d9534f;
    --info: #5bc0de;
    --success: #5cb85c;
    --border-color: #D9DEE4;
    --alternate-bg: #f8f9fa;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --border-radius: 8px;
    --spacing-unit: 1rem;
    --orange: #FF7000;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--secondary);
    color: var(--text);
    line-height: 1.55;
    overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

.container { max-width: 1200px; margin: 0 auto; padding: calc(var(--spacing-unit) * 1.25); }
img, embed { max-width: 100%; height: auto; display: block; }

/* Utility Classes */
.hidden { display: none !important; }
.empty-list-message { text-align: center; color: var(--secondary-text); padding: 1.5rem 1rem; font-style: italic; border: 1px dashed var(--border-color); border-radius: var(--border-radius); margin-top: 1rem; background-color: var(--alternate-bg); font-size: 0.9rem;}
.section-card { background-color: var(--background); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: var(--spacing-unit); box-shadow: 0 1px 3px var(--shadow-color); margin-bottom: calc(var(--spacing-unit) * 1.25); }
.section-card h2, .section-card h4 {
    margin: 0 0 var(--spacing-unit) 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.section-card h2 i.material-icons, .section-card h4 i.material-icons { font-size: 1.4rem; color: var(--primary); }

/* ================================================ */
/* SECTION 2: APP BAR (TOP NAVIGATION)              */
/* ================================================ */
.app-bar {
    background-color: var(--primary);
    height: 80px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    color: var(--text-light);
    padding: 30px 1rem 0 1rem;
}
.app-bar-back-button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    margin-right: auto;
    line-height: 1;
}
.app-bar-back-button i { vertical-align: middle; }
.app-bar-logo-link { height: 45px; }
.app-bar-logo { height: 100%; display: block; }
.app-bar-nav-container { margin-left: auto; display: flex; align-items: center; gap: 15px; }
.navbar-container { position: relative; }
.navbar-toggle { background: none; border: none; color: var(--text-light); cursor: pointer; padding: 5px; display: flex; align-items: center; justify-content: center; }
.navbar-toggle i { font-size: 24px; vertical-align: middle; }
.navbar-dropdown { position: absolute; right: 0; top: 100%; background-color: var(--background); border-radius: var(--border-radius); box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 200px; z-index: 1010; display: none; overflow: hidden; }
.navbar-dropdown.show { display: block; }
.navbar-item { display: flex; align-items: center; padding: 12px 16px; color: var(--primary-text); text-decoration: none; transition: background-color 0.2s ease; border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
.navbar-item:last-child { border-bottom: none; }
.navbar-item:hover { background-color: #f5f5f5; }
.navbar-item i.material-icons { margin-right: 12px; color: var(--primary); }
.navbar-item.disabled { color: #aaa; cursor: not-allowed; }
.navbar-item.disabled:hover { background-color: transparent; }
.notification-badge { background-color: var(--danger); color: var(--text-light); border-radius: 50%; width: 20px; height: 20px; font-size: 12px; display: flex; align-items: center; justify-content: center; margin-left: auto; }

/* ================================================ */
/* SECTION 3: BUTTONS & FORMS                       */
/* ================================================ */
button, input, textarea, select { font: inherit; margin: 0; }
.btn {
    padding: 10px 18px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 44px;
    border:none; cursor:pointer;
    transition: background-color 0.2s, opacity 0.2s, box-shadow 0.2s;
    display:inline-flex; align-items:center; justify-content:center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn:hover { box-shadow: 0 2px 4px rgba(0,0,0,0.1); opacity: 0.9; }
.btn i.material-icons { font-size: 1.2em; margin-right: 8px; }

.btn-primary { background-color: var(--primary); color: var(--text-light); }
.btn-secondary { background-color: var(--secondary-text); color: var(--text-light); }
.btn-success { background-color: var(--success); color: var(--text-light); }
.btn-danger { background-color: var(--danger); color: var(--text-light); }
.btn-warning { background-color: var(--warning); color: var(--primary-text); }
.btn-info { background-color: var(--info); color: var(--text-light); }

.form-group { margin-bottom: var(--spacing-unit); }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; color: var(--primary-text); }
.form-control, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background-color: var(--background);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
    color: var(--primary-text);
}
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16, 16, 52, 0.15); }
textarea.form-control { min-height: 80px; resize: vertical; }

.form-select {
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

/* ================================================ */
/* SECTION 4: MODAL STYLES                          */
/* ================================================ */
.modal-overlay, .modal {
    display: none; position: fixed; inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1050;
    align-items: center; justify-content: center;
    padding: var(--spacing-unit);
}
.modal-overlay:not(.hidden), .modal:not(.hidden) { display: flex; }

.modal-container, .modal-content {
    background-color: var(--background);
    padding: calc(var(--spacing-unit) * 1.5);
    width: 95%;
    max-width: 600px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.modal-title { font-family: 'Inter Tight', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--primary); margin: 0; }
.modal-close-x { background: none; border: none; font-size: 1.8rem; line-height: 1; color: var(--secondary-text); cursor: pointer; padding: 0; }
.modal-close-x:hover { color: var(--danger); }
.modal-body { padding-top: 0.5rem; }
.form-actions { margin-top: 1.5rem; display: flex; justify-content: flex-end; gap: calc(var(--spacing-unit)*0.75); border-top: 1px solid var(--border-color); padding-top: 1.5rem; }

/* ================================================ */
/* SECTION 5: LOADING INDICATOR                     */
/* ================================================ */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    justify-content: center; align-items: center;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}
.loading-icon-container {
    width: 128px; height: 128px; position: relative;
    -webkit-mask-image: url('../assets/icons/icon-128.webp'); mask-image: url('../assets/icons/icon-128.webp');
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    background-color: rgba(52, 152, 219, 0.25);
}
.loading-icon-container::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: var(--fill-percentage, 0%);
    background-color: rgb(52, 152, 219);
    transition: height 0.2s ease-out;
}
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px; height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s ease infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ================================================ */
/* SECTION 6: RESPONSIVE OVERRIDES                  */
/* ================================================ */
@media (max-width: 768px) {
    .container { padding: var(--spacing-unit); }
    .section-card { padding: var(--spacing-unit); }
    .section-card h2, .section-card h4 { font-size: 1.1rem; }
    .modal-container, .modal-content { width: 95%; padding: 1rem; }
    .form-actions { flex-direction: column; gap: 0.5rem; }
    .form-actions .btn { width: 100%; }
}