/* global.css - Matches Original BA Intranet Global Styles */

/* Basic Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
  
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
    padding-top: 0;
    padding-left: 300px;
}

/* Spacer element - hidden when using sidebar */
.spacer {
    display: none;
}

/* Header & Footer Base Styles */
footer {
    width: 100%;
    text-align: center;
    padding: 10px;
    margin-left: -300px;
    padding-left: 300px;
}

/* Legacy header styles - hidden when using sidebar */
header {
    display: none;
}

/* Header Button Styling - Complete Specifications */
/* Base Button */
.btn {
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

/* Logout Button Specific */
.logout-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Hover Effects */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    color: white;
}

/* Active State */
.btn:active {
    transform: translateY(0);
}

/* Responsive Behavior */
@media (max-width: 768px) {
    .btn {
        padding: 6px 12px;
    }
    
    .logout-btn {
        padding: 6px 12px;
    }
}

/* Navigation Styles */
nav {
    background-color: #fff;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

nav a {
    color: var(--main-color);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background-color: rgba(0, 51, 102, 0.1);
}

/* Button Styles */
button {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background-color: var(--main-color-dark);
    transform: translateY(-1px);
}

/* Active button state */
.btn.active,
.btn-primary.active,
.btn-outline-primary.active,
.btn-secondary.active,
.btn-outline-secondary.active,
.btn-success.active,
.btn-outline-success.active,
.btn-info.active,
.btn-outline-info.active,
.btn-warning.active,
.btn-outline-warning.active,
.btn-danger.active,
.btn-outline-danger.active {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

/* Button groups */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

th {
    background-color: var(--main-color);
    color: white;
    padding: 12px;
    text-align: left;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background-color: rgba(0, 51, 102, 0.05);
}

footer {
    background: linear-gradient(135deg, var(--footer-gradient-start), var(--footer-gradient-end));
    color: #333;
    padding: 20px;
    margin-top: 20px;
}

/* Input Styles */
input, select, textarea {
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--main-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.1);
}

/* Section Headers */
h1, h2, h3, h4, h5, h6 {
    text-align: left;
    font-weight: 500;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    color: var(--main-color);
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
    color: #000000 !important;
}

/* Override section header colors specifically */
.section-header h3,
.form-section h3,
.editable-section h3 {
    color: #000000 !important;
}

/* Main Container - Centered in remaining space after sidebar */
.main-container {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 30px 50px 0 50px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .main-container {
        width: 95%;
        padding: 20px 10px 0 10px;
    }
}

/* Links */
a {
    color: var(--main-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--main-color-dark);
}

/* Listing specific buttons */
.new-listing-button {
    background-color: var(--main-color);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin: 20px 0;
}

.new-listing-button:hover {
    background-color: var(--main-color-dark);
    transform: translateY(-1px);
}

/* Button class that uses the button-color variable */
.btn-listings {
    background-color: var(--button-color);
    border-color: var(--button-color);
    color: white;
}

.btn-listings:hover {
    background-color: var(--main-color-dark);
    border-color: var(--main-color-dark);
    color: white;
}

.btn-listings:focus, .btn-listings:active {
    background-color: #001a33;
    border-color: #001a33;
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(0, 51, 102, 0.5);
}

/* Clickable rows */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clickable-row:hover {
    background-color: rgba(0, 51, 102, 0.05) !important;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background-color: var(--status-active);
    color: white;
}

.status-pending {
    background-color: var(--status-pending);
    color: black;
}

.status-leased {
    background-color: var(--status-leased);
    color: white;
}

/* Dashboard stats cards */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    border-left: 4px solid var(--main-color);
}

.stats-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.stats-card-link:hover {
    transform: translateY(-2px);
}

.stats-card-link:hover .stats-card {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
}

/* Pending stats card styling */
.stats-card-pending {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px dashed #adb5bd;
    cursor: help;
}

.stats-card-pending:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--main-color);
    display: block;
}

.stats-label {
    color: #000000;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--main-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Amenities grid styling */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.amenities-grid .form-check {
    margin-bottom: 0;
}

.amenities-grid .form-check-label {
    font-weight: 500;
    margin-left: 5px;
}

@media (max-width: 768px) {
    .amenities-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Multi-Select Dropdown Styles */
/* Multi-select dropdown container */
.multi-select-container {
    position: relative;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #ffffff;
}

.multi-select-container.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.multi-select-field {
    padding: 8px 12px;
    min-height: 40px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    background: #ffffff;
    position: relative;
}

.multi-select-field .placeholder {
    color: #6c757d;
    font-style: italic;
    margin: 2px 0;
    flex: 1;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.selected-tag {
    background: var(--main-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-tag .remove-tag {
    cursor: pointer;
    font-weight: bold;
    margin-left: 4px;
    opacity: 0.8;
}

.selected-tag .remove-tag:hover {
    opacity: 1;
}

.dropdown-arrow {
    color: #6c757d;
    font-size: 12px;
    transition: transform 0.2s;
    margin-left: auto;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff !important;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 99999 !important;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
    backdrop-filter: blur(8px);
}

.multi-select-dropdown.show {
    display: block;
}

/* Critical fix: Elevate the entire section when dropdown is active */
.form-section:has(.multi-select-container.show),
.editable-section:has(.multi-select-container.show) {
    z-index: 100000 !important;
    position: relative !important;
    isolation: isolate;
}

/* Fallback for browsers without :has() support */
.form-section.dropdown-active,
.editable-section.dropdown-active {
    z-index: 100000 !important;
    position: relative !important;
    isolation: isolate;
}

.multi-select-container.show {
    z-index: 99998 !important;
    position: relative !important;
}

.dropdown-search {
    padding: 8px;
    border-bottom: 1px solid #eee;
    background: #ffffff !important;
}

.dropdown-search input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 12px;
    background: #ffffff !important;
}

.dropdown-options {
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff !important;
}

.dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff !important;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background-color: #f8f9fa !important;
}

.dropdown-option.selected {
    background-color: #e7f3ff !important;
    color: var(--main-color);
}

.dropdown-option .option-checkbox {
    width: 16px;
    height: 16px;
}

.dropdown-option.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .multi-select-dropdown {
        max-height: 300px;
    }
    
    .dropdown-options {
        max-height: 250px;
    }
    
    .selected-tag {
        max-width: 150px;
    }
} 

/* Analysis section horizontal layout */
.analysis-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Add more space between form sections */
.form-section {
    margin-bottom: 40px;
}

.form-section:last-child {
    margin-bottom: 20px;
}

/* Add extra space between page header and first form section */
.form-section:first-of-type {
    margin-top: 60px;
}

/* Current Property Rates section now uses standard form-section styling */
#propertyRatesSection .section-header h3 {
    color: #000000 !important;
    margin-bottom: 0.5rem;
}

#propertyRatesSection .section-header p {
    margin-bottom: 1rem;
    color: #000000;
}

.form-group.horizontal {
    display: flex;
    align-items: center;
    gap: 20px;
}

.form-group.horizontal label {
    min-width: 180px;
    margin-bottom: 0;
    font-weight: 500;
    flex-shrink: 0;
}

/* Analysis Information input containers and direct inputs */
.form-group.horizontal .input-with-button,
.form-group.horizontal .currency-display:not(.input-with-button *) {
    width: 200px !important;
    flex-shrink: 0;
}

/* Direct currency inputs in analysis grid (like Previous Rent Amount) */
.analysis-grid .form-group.horizontal .currency-display {
    width: 200px !important;
    max-width: 200px !important;
    min-width: 200px !important;
    flex-shrink: 0;
}

/* Make inputs sleeker with reduced height and compact width */
.analysis-grid .form-group.horizontal .input-group .form-control {
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 13px;
    border-radius: 3px;
    width: 80px !important; /* Compact width for rent amounts */
    max-width: 80px !important;
    min-width: 80px !important;
}

/* Input with button container for Analysis Information */
.analysis-grid .input-with-button {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 200px;
}

/* Currency input styling - clean and simple */
.currency-input,
.currency-display {
    width: 200px !important;
    max-width: 200px !important;
    min-width: 200px !important;
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    border-radius: 3px;
    border: 1px solid #ddd;
    text-align: left;
}

/* Read-only currency displays */
.currency-display {
    background-color: #f8f9fa;
    color: #495057;
}

/* Refresh button styling */
.refresh-btn {
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 12px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

/* Old input-group styling removed - now using currency-input approach */

/* Old button and input-group styling removed - now using refresh-btn approach */

/* Support for inline timestamp on Market Rent */
.form-group.horizontal {
    align-items: center;
    flex-wrap: nowrap;
}

.form-group.horizontal .form-text {
    white-space: nowrap;
    margin-bottom: 0;
}

/* Responsive design for analysis grid */
@media (max-width: 768px) {
    .form-group.horizontal {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-group.horizontal label {
        min-width: auto;
        width: 100%;
    }
    
    .form-group.horizontal .input-group,
    .form-group.horizontal .input-container {
        width: 100% !important;
    }
} 

/* Make all input fields and selects have consistent height (but not textareas) */
input[type="text"].form-control,
input[type="number"].form-control,
input[type="email"].form-control,
input[type="tel"].form-control,
input[type="url"].form-control,
input[type="password"].form-control,
input[type="date"].form-control,
select.form-control {
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 13px;
    border-radius: 3px;
}

/* Specifically target Unit Details and Property Details input fields */
.form-section input[type="number"].form-control,
.form-section input[type="text"].form-control,
.form-section select.form-control {
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 13px;
    border-radius: 3px;
}

/* Input groups in Unit Details (like square feet with "sq ft" suffix) */
.form-section .input-group .form-control {
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 13px;
}

.form-section .input-group-text {
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 13px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
}

/* Keep textareas with their own sizing */
textarea.form-control {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    /* Let textareas keep their default/specified heights */
} 

/* Listing Details section - 2 column grid layout */
.listing-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 40px;
    align-items: start;
}

/* Horizontal layout for listing details fields */
.listing-details-grid .form-group.horizontal {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
}

.listing-details-grid .form-group.horizontal label {
    min-width: 120px;
    margin-bottom: 0;
    font-weight: 500;
    flex-shrink: 0;
    font-size: 13px;
}

/* Set 200px width for listing details inputs */
.listing-details-grid .form-group.horizontal input.form-control,
.listing-details-grid .form-group.horizontal select.form-control {
    width: 200px !important;
    max-width: 200px !important;
    min-width: 200px !important;
    flex-shrink: 0;
}

/* Clean listing details layout - no positioning needed */

/* Clean up - removed old input-group specific styling since we switched to direct inputs */

/* Special handling for inline small text */
.listing-details-grid .form-group.horizontal .form-text {
    font-size: 10px;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Responsive design for listing details grid */
@media (max-width: 900px) {
    .listing-details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .listing-details-grid .form-group.horizontal {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .listing-details-grid .form-group.horizontal label {
        min-width: auto;
        width: 100%;
    }
    
    .listing-details-grid .form-group.horizontal input.form-control,
    .listing-details-grid .form-group.horizontal select.form-control {
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
    }
}

/* Metrics section info-row styling for better spacing */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    min-height: 24px;
}

.info-label {
    font-weight: 500;
    color: #495057;
    flex: 0 0 auto;
    min-width: 160px;
    white-space: nowrap;
}

.info-value {
    flex: 1;
    text-align: right;
    margin-left: 20px;
}

/* Sidebar responsive adjustments */
@media (max-width: 768px) {
    body {
        padding-left: 0;
    }
    
    footer {
        margin-left: 0;
        padding-left: 10px;
    }
} 