/* Base styles for AXXA Project */
:root {
    --bg-color: #000000;
    --card-bg: #1E1E1E;
    --card-hover: #2A2A2A;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --accent-blue: #00AEEF;
    --alarm-red: #FE4A49;
    --trouble-yellow: #FFCB05;
    --status-green: #00DBA3;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Header & Typography */
header {
    background: transparent;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 2px solid #1a1a1a;
}

.title-section {
    text-transform: uppercase;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin: 20px 0 20px;
    letter-spacing: 2px;
}

/* Navigation & Menu */
.navbar-brand {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
}

.brand-blue {
    color: var(--accent-blue);
}

.menu-trigger {
    position: absolute;
    right: 20px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-primary);
    background: #1a1a1a;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.3s ease;
}

.menu-trigger:hover {
    background: #333;
    transform: scale(1.05);
}

.back-btn {
    position: absolute;
    left: 20px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-primary);
    background: #1a1a1a;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #333;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1001;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 100px 40px;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

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

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.menu-items li {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-menu.active .menu-items li {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation for menu items */
.side-menu.active .menu-items li:nth-child(1) {
    transition-delay: 0.1s;
}

.side-menu.active .menu-items li:nth-child(2) {
    transition-delay: 0.15s;
}

.side-menu.active .menu-items li:nth-child(3) {
    transition-delay: 0.2s;
}

.side-menu.active .menu-items li:nth-child(4) {
    transition-delay: 0.25s;
}

.side-menu.active .menu-items li:nth-child(5) {
    transition-delay: 0.3s;
}

.side-menu.active .menu-items li:nth-child(6) {
    transition-delay: 0.35s;
}

.side-menu.active .menu-items li:nth-child(7) {
    transition-delay: 0.4s;
}

.side-menu.active .menu-items li:nth-child(8) {
    transition-delay: 0.45s;
}

.side-menu.active .menu-items li:nth-child(9) {
    transition-delay: 0.5s;
}

.side-menu.active .menu-items li:nth-child(10) {
    transition-delay: 0.55s;
}

.side-menu.active .menu-items li:nth-child(11) {
    transition-delay: 0.6s;
}

.menu-items li a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    display: block;
    padding: 10px 0;
    letter-spacing: 0.5px;
    position: relative;
}

.menu-items li a.active {
    color: var(--text-primary);
    font-weight: 700;
}

.menu-items li a.active::before {
    content: '';
    position: absolute;
    left: -40px;
    width: 4px;
    height: 24px;
    background: var(--accent-blue);
    border-radius: 0 4px 4px 0;
}

.menu-items li a:hover {
    color: var(--accent-blue);
    transform: translateX(5px);
}

.menu-spacer {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
    width: 100%;
}

.close-menu {
    position: absolute;
    top: 30px;
    right: 30px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.close-menu:active {
    transform: rotate(90deg) scale(0.9);
}

/* Card Styling */
.building-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.building-card:hover {
    background: var(--card-hover);
    transform: translateY(-4px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(0, 174, 239, 0.1);
}

.building-img {
    width: 100px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
}

.building-info {
    flex-grow: 1;
}

.building-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.building-address {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.status-indicator {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.status-alarm {
    border-color: var(--alarm-red);
    color: var(--alarm-red);
}

.status-trouble {
    border-color: var(--trouble-yellow);
    color: var(--trouble-yellow);
}

.status-ok {
    border-color: var(--status-green);
    color: var(--status-green);
}

/* Form Elements */
.ax-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 400px;
    margin: 40px auto;
}

.ax-input {
    background: #f5f5f5;
    border: none;
    border-radius: 0;
    height: 55px;
    width: 100%;
    margin-bottom: 20px;
    padding: 0 20px;
    font-size: 1rem;
    color: #333;
}

.password-group {
    position: relative;
    margin-bottom: 20px;
}

.password-group {
    position: relative;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-56%);
    /* Match vertical alignment with text centering */
    cursor: pointer;
    color: #000;
    z-index: 10;
}

.toggle-password:hover {
    color: #000;
}

.ax-btn-outline {
    background: transparent;
    border: 1.5px solid #FFFFFF;
    color: white;
    padding: 12px 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    width: fit-content;
}

.ax-btn-outline:hover {
    background: white;
    color: black;
}

.ax-link {
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    transition: opacity 0.3s;
}

.ax-link:hover {
    opacity: 0.7;
}


/* Photo Upload Styling */
.photo-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
}

.photo-preview-container {
    width: 100px;
    height: 100px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.photo-preview-container:hover {
    transform: scale(1.05);
    border-color: var(--accent-blue);
}

.photo-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-placeholder {
    font-size: 2rem;
    color: #999;
}

.photo-upload-btn {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.photo-upload-btn:hover {
    color: var(--accent-blue);
}

/* Image Edit Reusable Style */
.image-edit-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
}

.image-edit-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-edit-wrapper:hover img {
    transform: scale(1.05);
}

.image-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.image-edit-wrapper:hover .image-edit-overlay {
    opacity: 1;
}

.image-edit-overlay i {
    color: white;
    font-size: 1.2rem;
}

/* Shape Variant Utilities */
.image-edit-wrapper.is-round,
.image-edit-wrapper.is-round .image-edit-overlay,
.image-edit-wrapper.is-round img {
    border-radius: 50% !important;
}

.image-edit-wrapper.is-square,
.image-edit-wrapper.is-square .image-edit-overlay,
.image-edit-wrapper.is-square img {
    border-radius: 12px !important;
}

.image-edit-wrapper.is-rectangle,
.image-edit-wrapper.is-rectangle .image-edit-overlay,
.image-edit-wrapper.is-rectangle img {
    border-radius: 0 !important;
}


/* Detail View Layout */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.filter-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.filter-btn {
    background: var(--card-bg);
    border: 1.2px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4); 
    padding: 15px 25px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 110px;
    justify-content: center;
}

.filter-btn .status-indicator {
    /* filter: grayscale(1);  */
    opacity: 0.3;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: var(--card-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: #1a1a1a;
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
}

.filter-btn.active .status-indicator {
    filter: grayscale(0);
    opacity: 1;
}

.report-btn {
    width: 100%;
    border: 1px solid white;
    background: transparent;
    color: white;
    padding: 15px;
    border-radius: 0;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-transform: none;
    font-weight: 400;
    font-size: 1.1rem;
}

/* Floors & Units */
.floor-card {
    background: var(--card-bg);
    border-radius: 24px;
    margin-bottom: 15px;
    overflow: hidden;
}

.floor-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.floor-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.chevron-icon {
    transition: transform 0.3s;
}

.chevron-icon.rotate {
    transform: rotate(180deg);
}

.unit-row {
    background: #252525;
    border-radius: 12px;
    margin: 5px 15px 15px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unit-id {
    font-weight: 600;
    font-size: 1.1rem;
}

.unit-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.unit-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 991px) {
    .detail-grid {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 20px;
    }

    .detail-grid>* {
        min-width: 0;
        width: 100%;
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .ax-card {
        margin: 15px;
        padding: 25px 15px;
    }

    .filter-buttons {
        gap: 10px;
        padding: 5px;
        margin: 20px 0;
        overflow-x: auto;
        justify-content: center;
        -ms-overflow-style: none;
        scrollbar-width: none;
        width: 100%;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex: 1;
        min-width: calc(25% - 10px);
        padding: 10px 5px;
        border-radius: 12px;
        white-space: nowrap;
    }

    .unit-row {
        padding: 15px;
        gap: 12px;
        margin: 5px 10px 10px;
    }

    .unit-id {
        font-size: 0.95rem;
        min-width: 35px;
    }

    .unit-status {
        font-size: 0.75rem;
        flex: 1;
        text-align: center;
        line-height: 1.3;
    }

    .unit-time {
        font-size: 0.7rem;
        min-width: 45px;
        text-align: right;
    }

    .building-card {
        padding: 10px;
        border-radius: 15px;
    }

    .building-img {
        width: 80px;
        height: 80px;
        border-radius: 12px;
    }

    .building-name {
        font-size: 0.95rem;
    }

    .building-address {
        font-size: 0.7rem;
    }

    .report-btn {
        margin-top: 15px;
        padding: 18px;
        font-size: 1rem;
        border-radius: 50px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    /* Building summary specific for mobile */
    .building-summary {
        margin-bottom: 30px;
    }

    .building-summary .building-card {
        margin-bottom: 0;
        background: rgba(255, 255, 255, 0.03);
    }

    .status-filtering h6 {
        font-size: 0.75rem;
        margin-bottom: 15px;
        display: block !important;
        text-align: center;
    }

    .unit-group {
        display: none;
    }

    .unit-group.active {
        display: block;
    }

    .floor-header {
        padding: 15px;
    }

    .floor-header span {
        font-size: 0.8rem;
    }

    .side-menu {
        width: 85%;
        max-width: 320px;
    }
}

@media (max-width: 480px) {
    .filter-btn span {
        font-size: 0.85rem;
    }

    .status-indicator i {
        font-size: 1.1rem !important;
    }

    .title-section {
        font-size: 1rem;
        margin: 25px 0 15px;
    }
}

/*
@media (min-width: 992px) {
    .unit-page-grid .building-card {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        overflow: hidden;
    }

    .unit-page-grid .building-img {
        width: 100%;
        height: 200px;
        border-radius: 12px 12px 0 0;
    }

    .unit-page-grid .building-info {
        padding: 20px;
    }

    .vertical-filters .filter-btn {
        min-height: 60px;
    }
}

.unit-selector span {
    white-space: nowrap;
}
*/


/* Centering for Login/Register Pages */
.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-page main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-bottom: 80px;
    /* Offset for better visual balance */
}

.auth-page .title-section {
    margin-top: 0;
}

.auth-page .ax-card {
    margin: 0;
    width: 100%;
}

.status-indicator {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.status-alarm {
    background-color: #ef4444;
    color: white;
}

.status-trouble,
.status-gear {
    background-color: #eab308;
    color: white;
}

.status-ok {
    background-color: #10b981;
    color: white;
}

/* Filter Pill Shapes */
.filter-btn {
    border-radius: 50px !important;
}

.zone-item {
    border-radius: 50px !important;
    background: #1a1a1a !important;
}

.valve-card {
    background: #1a1a1a !important;
}

.unit-selector {
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.text-thin {
    font-weight: 200;
}

.column-header {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: 0.1em;
}

.unit-selector {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.unit-selector .unit-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.unit-selector .unit-floor {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.unit-selector .unit-label {
    font-size: 0.95rem;
    color: white;
    font-weight: 300;
}

.status-badge {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-badge.bg-info {
    background: var(--accent-blue) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(0, 174, 239, 0.2);
}

.valve-card {
    background: #1a1a1a !important;
    border-radius: 24px;
    padding: 25px;
    margin-top: 15px;
}

.zone-item {
    background: #1a1a1a !important;
    border-radius: 50px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hold-btn,
.report-btn {
    background: #000 !important;
    border: 1.5px solid white !important;
    color: white !important;
    padding: 15px;
    border-radius: 20px;
    font-weight: 500;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hold-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: none;
    z-index: 1;
}

.hold-btn.holding::before {
    transform: scaleX(1);
    transition: transform 3s linear;
}

.hold-btn span {
    position: relative;
    z-index: 2;
}

.report-btn:hover {
    border-color: var(--accent-blue) !important;
    color: var(--accent-blue) !important;
}


.btn:hover {
    border-color: var(--accent-blue) !important;
    color: var(--accent-blue) !important;
}

@media (max-width: 768px) {
    .report-btn {
        border-radius: 50px;
    }
}

/* Vertical Filters for Unit Screen (Desktop) */
@media (min-width: 992px) {
    .btn-label {
        display: block;
    }

    .vertical-filters {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .vertical-filters .filter-btn {
        background: #1a1a1a;
        justify-content: space-between;
        padding: 15px 20px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* Horizontal Filters for Unit Screen (Mobile) */
@media (max-width: 991px) {
    .unit-page-grid .filter-buttons {
        display: flex;
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .unit-page-grid .filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .unit-page-grid .filter-btn {
        flex: 1;
        justify-content: center;
        padding: 12px;
        margin-bottom: 0 !important;
    }

    .unit-page-grid .filter-btn .btn-count {
        margin-right: 8px;
    }
}

.btn-label {
    display: none;
}

@media (min-width: 992px) {
    .btn-label {
        display: block;
    }
}