@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .form-container,
    .result-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
}


body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f8f8;
}

h1 {
    text-align: center;
}

h3 {
    color: #4CAF50;
}

h4 {
    color: gray;
}

.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 10px 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    box-sizing: border-box;
}

.logo-title {
    display: flex;
    align-items: center;
    left: 20px;
}

.company-logo {
    height: 60px;
    width: auto;
}

.page-title {
    flex: 1;
    padding: 5px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.actions-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;    
    gap: 10px;
    width: 100%;
    max-width: 100%;
}


.actions-bar-row
 {
    display: flex;
    gap: 10px;
 }

.search-box-container {
    flex: 1 1 auto;
    max-width: 400px;
    position: relative;
}

.search-box-container input#search {
    width: 100%;
    height: 40px;             
    padding: 0 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.LL97-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;         
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background-color: #f2f2f2;
    transition: background-color 0.3s;
}

.LL97-icon-link:hover {
    background-color: #e0e0e0;
}

@media (max-width: 768px) {
    .logo-title {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }

    .company-logo {
        margin-left: 0;
    }

    .page-title {
        font-size: 1.2rem;
        text-align: center;
    }
}

/****************** Container for search results *****************/
/* Container for search results */
#results {
	position: absolute;
	top: 100%;              
	left: 0;	
	background-color: #fff;
	border: 1px solid #ccc;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	z-index: 999;
	margin-top: 5px;
	padding: 0;
	list-style: none;
    display: none;

	/* Size logic */
	width: 100%;              /* Matches input width exactly */
	max-width: 500px;         /* Limit max width */
	min-width: 200px;         /* Set minimum to prevent collapse */
	overflow-y: auto;
	max-height: 220px;        /* Max 4 results visible */
}

/* Each result item */
#results li {
	padding: 10px 12px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	display: flex;
	flex-direction: column;
	border-bottom: 1px solid #f0f0f0;
}

/* Hover effect */
#results li:hover {
	background-color: #f5f5f5;
}

/* Bold property name */
#results li .property-name {
	font-weight: bold;
	color: #222;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Lighter address line */
#results li .address {
	font-size: 0.9em;
	color: #555;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#results li .totalSF {
	font-size: 0.85em;
	color: #777;
	margin-top: 2px;
}


.selected-property-name {
    font-weight: bold;
    color: 	#3686e1;
    font-size: 1rem;
    margin-right: auto;
    padding-right: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 768px) {
    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .selected-property-name {
        text-align: center;
        font-size: 1.1rem;
        font-weight: bold;
        margin-top: 10px;
        margin-bottom: 5px;
    }

    .actions-bar-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .search-box-container {
        flex: 1;
        min-width: 150px;
    }

    .LL97-icon-link {
        flex-shrink: 0;
    }
}

/****************** Container Layout *****************/
.main-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
}

.form-container {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-sizing: border-box;
    flex: 1 1 1%;
}

.result-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-sizing: border-box;
    flex: 1 1 50%;
}


/****************** Input Display *****************/

.buildingType-container {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: 140px;
    background-color: dark;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* Position the tooltip above the text */
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.3s;
}

.buildingType-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

#defaultRates {
    margin-top: 10px;
    margin-bottom: 10px;
}

label[for='defaultRates'] {
    margin-left: 5px;
}



#buildingInputsContainer,
#EnergyInputsContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header {
    display: flex;
    font-weight: bold;
    padding-bottom: 10px;
}

.header div {
    flex: 1;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.row select,
.row input {
    flex: 1;
    min-width: 0;
}

input.spaceArea,
input#electricity,
input#gas,
input#oil,
input#steam,
input#kWhRate,
input#gasRate,
input#oilRate,
input#steamRate{
    text-align: right;
}


.row .deleteBuilding {
    flex: 0 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group label {
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

#totalSFDisplay {
    margin-top: 10px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 1.1em;
    color: #333;
    background-color: #f2f2f2;
}


/****************** Result Display *****************/
.result-display {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.result-display div {
    flex: 1 1 40%;
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.result-display div strong {
    font-size: 1.8em;
    display: block;
}

/****************** Chart layout *****************/
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    margin-top: 20px;

}

.chart-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.chart-item canvas {
    width: 100% !important;
    height: 350px !important;
    max-width: 100%;
}



@media (min-width: 768px) {
    .charts-container {
        flex-direction: row;
    }

    .chart-item {
        flex: 1 1 45%;
    }
}

#utilityCostTableContainer, #buildingInfoTableContainer {
    width: 100%;
    margin-top: 10px; 
    text-align: center;
    position: relative;
}

@media (max-width: 768px) {
    #utilityCostTableContainer {
        overflow-x: hidden;
        padding-bottom: 10px;
    }

    #utilityCostTableContainer table {
        font-size: 0.7rem;     /* Slightly smaller text for mobile */
        table-layout: fixed;     /* Ensures cells don’t overflow */
        word-wrap: break-word;   /* Break long words */
    }

    #utilityCostTableContainer th,
    #utilityCostTableContainer td {
        padding: 6px;
        white-space: normal;     /* Allow wrapping */
        word-break: break-word;  /* Break long strings */
    }
}


.sub-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: white;
}

.sub-table th, .sub-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.sub-table th {
    background-color: #4CAF50;
    color: white;
}

.sub-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.sub-table tr:hover {
    background-color: #ddd;
}


button {
    background-color: #4caf50;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    margin-top: 5px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.buildingType {
    width: 100px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.buildingType option {
    width: auto; /* Ensure the drop-down list maintains its width */
}

/****************** Print Preview Styles *****************/
/* @media print {
    #carbonEmissionChart {
        height: 180px !important;
    }

} */


/****************** Modal Styles *****************/
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0, 0, 0); /* Fallback color */
    background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}