/* ==================== RESET & VARIABLES ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --primary-blue: #2C5F7C;
    --primary-green: #7FB069;
    --primary-brown: #C1A772;
    
    /* UI Colors */
    --dark-blue: #1a3f52;
    --light-blue: #e8f1f5;
    --accent-green: #6a9a5b;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --background: #f8f9fa;
    --white: #ffffff;
    --border: #dee2e6;
    --shadow: rgba(44, 95, 124, 0.1);
    --shadow-dark: rgba(44, 95, 124, 0.2);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Poppins', sans-serif;
    
    /* Spacing */
    --header-height: 60px;
    --bottom-nav-height: 65px;
    --search-height: 70px;
}

/* ==================== GLOBAL STYLES ==================== */

body {
    font-family: var(--font-primary);
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== HEADER ==================== */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 2px 10px var(--shadow-dark);
    z-index: 100;
}

.back-btn, .menu-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.back-btn:active, .menu-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
}

.header-logo {
    width: 32px;
    height: auto;
    border-radius: 0;
}

/* ==================== SEARCH BAR ==================== */

.search-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    padding: 12px 16px;
    box-shadow: 0 2px 8px var(--shadow);
    z-index: 99;
    display: none;
}

.search-container.active {
    display: block;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 10px 16px;
    gap: 10px;
}

.search-bar i {
    color: var(--text-light);
    font-size: 18px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--text-dark);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-light);
}

.filter-btn {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.filter-btn:active {
    background: var(--dark-blue);
}

/* ==================== BREADCRUMBS ==================== */

.breadcrumbs {
    position: fixed;
    top: calc(var(--header-height) + var(--search-height));
    left: 0;
    right: 0;
    background: var(--white);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    z-index: 98;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: var(--text-light);
}

.breadcrumb-item.active {
    color: var(--primary-blue);
    font-weight: 500;
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
    flex: 1;
    padding: calc(var(--header-height) + 20px) 16px calc(var(--bottom-nav-height) + 20px);
    min-height: 100vh;
}

.main-content.with-search {
    padding-top: calc(var(--header-height) + var(--search-height) + 20px);
}

/* ==================== BOTTOM NAVIGATION ==================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.nav-item i {
    font-size: 20px;
    transition: transform 0.3s;
}

.nav-item.active {
    color: var(--primary-blue);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 0 0 3px 3px;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-item.active::before {
    opacity: 1;
}

/* ==================== SIDE MENU ==================== */

.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: 2px 0 10px var(--shadow-dark);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.side-menu-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.side-menu-header img {
    width: 48px;
    height: auto;
    border-radius: 0;
}

.side-menu-header h3 {
    flex: 1;
    font-family: var(--font-display);
    font-size: 20px;
}

.close-menu {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-menu-list {
    list-style: none;
    padding: 12px 0;
}

.side-menu-list li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.3s;
}

.side-menu-list li a:active {
    background: var(--light-blue);
}

.side-menu-list li a i {
    width: 24px;
    color: var(--primary-blue);
    font-size: 18px;
}

.side-menu-list li.divider {
    height: 1px;
    background: var(--border);
    margin: 12px 20px;
}

/* ==================== OVERLAY ==================== */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ==================== MODAL ==================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow-dark);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--primary-blue);
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ==================== FORM ELEMENTS ==================== */

.filter-group {
    margin-bottom: 16px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-primary);
    color: var(--text-dark);
    background: var(--white);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* ==================== BUTTONS ==================== */

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-primary);
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:active {
    background: var(--dark-blue);
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-dark);
}

.btn-secondary:active {
    background: var(--border);
    transform: scale(0.98);
}

/* ==================== UTILITY CLASSES ==================== */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
    display: none !important;
}

/* ==================== RESPONSIVE ==================== */

@media (min-width: 768px) {
    .main-content {
        padding-left: 32px;
        padding-right: 32px;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .main-content {
        padding-bottom: 40px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 1200px;
        margin: 0 auto;
    }
}
