/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.version-badge {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: #2980b9;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px;
    background-color: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.main-content {
    flex: 2;
    min-width: 0;
}

.results-sidebar {
    flex: 1;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

h1, h2, h3, h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    font-size: 2.2rem;
    color: #2980b9;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

h2 {
    margin-top: 25px;
    font-size: 1.8rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

h3 {
    margin-top: 15px;
    font-size: 1.4rem;
    color: #34495e;
}

h4 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-top: 20px;
}

h5 {
    font-size: 1.1rem;
    color: #2980b9;
    margin: 15px 0 10px;
}

/* Form Elements */
label {
    display: block;
    margin: 15px 0 5px;
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

input[type="number"], 
input[type="text"], 
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #f9f9f9;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input[type="number"]:focus, 
input[type="text"]:focus, 
select:focus {
    border-color: #3498db;
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

/* Buttons */
button {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 15px 0;
    transition: background-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#generate-pdf {
    background-color: #27ae60;
}

#generate-pdf:hover {
    background-color: #219653;
}

.remove-comp-btn {
    background-color: #e74c3c;
    width: auto;
    padding: 8px 15px;
    margin-top: 10px;
}

.remove-comp-btn:hover {
    background-color: #c0392b;
}

/* Property Image */
#property-image {
    margin: 20px 0;
    text-align: center;
}

#street-view-image {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
}

/* Results Section */
#results {
    margin-top: 0;
    padding: 15px;
    border-radius: 6px;
    background-color: #f8fafc;
    border: 1px solid #e1e5eb;
    transition: opacity 0.3s ease;
}

#results.calculating {
    opacity: 0.6;
    position: relative;
}

#results.calculating::after {
    content: "Calculating...";
    position: absolute;
    top: 10px;
    right: 20px;
    color: #3498db;
    font-size: 0.8rem;
    font-style: italic;
}

#summary-results p {
    margin: 12px 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

#summary-results span {
    font-weight: 600;
    color: #2980b9;
}

/* Calculation Steps */
#arv-calculation {
    margin-top: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e5eb;
    font-size: 0.9rem;
    line-height: 1.6;
    transition: opacity 0.3s ease;
}

#arv-calculation.calculating {
    opacity: 0.6;
}

.comp-analysis {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e5eb;
}

.adjustments-table {
    width: 100%;
    margin: 10px 0;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 0.9rem;
}

.adjustments-table th, 
.adjustments-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #e1e5eb;
}

.adjustments-table th {
    background-color: #3498db;
    color: white;
}

.adjustments-table tr.total-adjustment {
    background-color: #f1f8fe;
    font-weight: bold;
}

.arv-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #e8f4fc;
    border-radius: 6px;
    border: 1px solid #cfe2f3;
}

/* Tables */
table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

th, td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #e1e5eb;
}

th {
    background-color: #3498db;
    color: white;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f8fafc;
}

tr:hover {
    background-color: #f1f5f9;
}

/* Comparable Properties */
.comp {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 6px;
    background-color: #f8fafc;
    border: 1px solid #e1e5eb;
    position: relative;
}

.comp label {
    margin: 10px 0 5px;
}

.comp input[type="number"], 
.comp input[type="text"], 
.comp select {
    margin-bottom: 12px;
}

/* Map Container */
#map-container {
    margin-top: 30px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#map {
    height: 300px;
    width: 100%;
    border-radius: 6px;
}

/* Info Windows */
.gm-style .gm-style-iw {
    font-weight: bold;
    padding: 10px;
    font-size: 14px;
}

.gm-style .gm-style-iw-c {
    border-radius: 6px;
    padding: 10px;
}

/* Error Messages */
.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin: -10px 0 15px;
    display: none;
    padding: 5px;
    border-radius: 4px;
    background-color: #fdecea;
}

.required-field::after {
    content: " *";
    color: #e74c3c;
}

/* Loading Spinner */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

#loading p {
    margin-top: 15px;
    font-weight: bold;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* PDF Loading */
.pdf-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 2000;
    color: white;
}

.pdf-loading .spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
    
    .results-sidebar {
        position: static;
        max-height: none;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    input, select, textarea {
        font-size: 16px;
    }
    
    .pac-container {
        z-index: 1050 !important;
    }
    
    button, input[type="button"], input[type="submit"] {
        min-height: 44px;
    }
    
    #address {
        touch-action: manipulation;
    }

    #map {
        height: 250px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .comp {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    button {
        padding: 10px;
        font-size: 0.9rem;
    }

    #map {
        height: 200px;
    }
}