/* CSS Custom Properties */
:root {
    --accent-color: #B5CD28;
    --accent-hover: #9fb122;
    --primary-text: #333333;
    --secondary-text: #666666;
    --border-color: #e0e0e0;
    --background-light: #f8f9fa;
    --background-white: #ffffff;
    --error-color: #BF1F1F;
    --warning-color: #fd7e14;
    --success-color: #B5CD28;
    --info-color: #17a2b8;
    --potential-color: #2382C1;
    --current-normal: #6c757d;
    --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Noto Sans', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--primary-text);
    background-color: var(--background-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-text);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 1.8rem;
    color: var(--accent-color);
}

h3 {
    font-size: 1.4rem;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    min-height: auto;
    display: flex;
    flex-direction: column;
}



/* Main Content */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 100%;
    margin: 0;
    width: 100%;
}

/* Form Styles */
.calculator-form {
    background: var(--background-white);
    padding: 2rem;
    border-radius: 0;
    box-shadow: none;
    border: none;
    margin: 0;
}

.form-section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

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

.form-section h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
    color: var(--primary-text);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary-text);
    position: relative;
}

.tooltip {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--secondary-text);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    margin-left: 8px;
    cursor: help;
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-text);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow-medium);
}

/* Input Styles */
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: 'Noto Sans', sans-serif;
    transition: var(--transition);
    background: var(--background-white);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(181, 205, 40, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover {
    border-color: var(--accent-hover);
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    flex: 1;
    padding-right: 60px;
}

.input-with-unit .unit {
    position: absolute;
    right: 16px;
    color: var(--secondary-text);
    font-weight: 500;
}

.input-with-toggle {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-with-toggle input {
    flex: 1;
}

.unit-toggle {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.unit-btn {
    padding: 12px 16px;
    border: none;
    background: var(--background-white);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    color: var(--secondary-text);
}

.unit-btn.active {
    background: var(--accent-color);
    color: white;
}

.unit-btn:hover:not(.active) {
    background: var(--background-light);
}

.help-link {
    margin-top: 8px;
}

.help-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
}

.help-link a:hover {
    text-decoration: underline;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.radio-option input[type="radio"] {
    width: auto;
    margin-top: 4px;
    accent-color: var(--accent-color);
}

.radio-option label {
    margin-bottom: 0;
    cursor: pointer;
    flex: 1;
}

/* Form Actions */
.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.calculate-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Roboto Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calculate-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Results Section */
.results {
    background: var(--background-white);
    padding: 2rem;
    border-radius: 0;
    box-shadow: none;
    border: none;
    margin: 0;
}

.results.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
}

.results-header h2 {
    margin-bottom: 0;
}

.back-btn {
    background: var(--border-color);
    color: var(--primary-text);
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
}

.back-btn:hover {
    background: var(--secondary-text);
    color: white;
}

.results-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
    text-align: center;
    transition: var(--transition);
}

.result-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--primary-text);
}

.time-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.time-value {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    transition: var(--transition);
}

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

/* Potential Cleaning Time - Blue theme */
.potential-card {
    border-left-color: var(--potential-color);
}

.potential-card .time-value {
    color: var(--potential-color);
}

/* Current Method - Dynamic color based on efficiency */
.current-card {
    border-left-color: var(--current-normal);
}

.current-card .time-value {
    color: var(--current-normal);
}

.current-card.inefficient {
    border-left-color: var(--warning-color);
    background: rgba(253, 126, 20, 0.05);
}

.current-card.inefficient .time-value {
    color: var(--warning-color);
}

.current-card.very-inefficient {
    border-left-color: var(--error-color);
    background: rgba(191, 31, 31, 0.05);
}

.current-card.very-inefficient .time-value {
    color: var(--error-color);
}

/* Savings Card - Green theme */
.savings-card {
    border-left-color: var(--success-color);
    background: rgba(181, 205, 40, 0.05);
}

.savings-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.savings-time {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.savings-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--success-color);
    font-family: 'Roboto Condensed', sans-serif;
}

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

.savings-percentage {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--success-color);
}

.machine-selector {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

.machine-selector label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary-text);
}

.machine-selector select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--background-white);
    transition: var(--transition);
}

.machine-selector select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(181, 205, 40, 0.15);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--background-white);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

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

.modal-header h3 {
    margin-bottom: 0;
}

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

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.map-container {
    height: 500px;
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.google-map {
    flex: 1;
    min-height: 350px;
    width: 100%;
}

.map-instructions {
    padding: 1rem;
    background: var(--background-white);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.map-instructions p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-text);
}

.area-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-text);
    margin-top: 0.5rem;
}

.area-display #selected-area {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.search-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--background-white);
    border-bottom: 1px solid var(--border-color);
}

#location-search {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-family: var(--font-family);
}

#location-search:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(35, 130, 193, 0.1);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: #1e6fa8;
}

.search-btn:active {
    transform: translateY(1px);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.search-suggestion {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--background-light);
    transition: background-color 0.2s ease;
}

.search-suggestion:hover {
    background: var(--background-light);
}

.search-suggestion:last-child {
    border-bottom: none;
}

.search-container {
    position: relative;
}

/* Optional field styling */
.optional-field {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: normal;
}

/* Style Google Places Autocomplete Element */
gmp-placeautocomplete {
    width: 100% !important;
    flex: 1 !important;
}

gmp-placeautocomplete input {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    font-size: 1rem !important;
    font-family: inherit !important;
    background: white !important;
    box-sizing: border-box !important;
}

gmp-placeautocomplete input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(35, 130, 193, 0.2) !important;
}

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

.btn-secondary,
.btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

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

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

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

.btn-primary:hover {
    background: var(--accent-hover);
}



/* Iframe Optimization */
body {
    margin: 0;
    padding: 0;
}

.container {
    min-height: auto;
    padding: 0;
}

/* Responsive Design */
@media (min-width: 768px) {
    .results-summary {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .radio-group {
        gap: 16px;
    }
    
    .calculator-form,
    .results {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .results-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .container {
        padding: 0;
    }
    
    .calculator-form,
    .results {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    .input-with-toggle {
        flex-direction: column;
        align-items: stretch;
    }
    
    .unit-toggle {
        align-self: flex-start;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .time-value,
    .savings-value {
        font-size: 1.8rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .map-container {
        height: 400px;
    }
    
    .google-map {
        min-height: 300px;
    }
    
    .map-instructions {
        padding: 0.75rem;
    }
    
    .map-instructions p {
        font-size: 0.85rem;
    }
    
    .search-container {
        flex-direction: column;
        padding: 0.75rem;
    }
    
    .search-container #location-search {
        margin-bottom: 0.5rem;
    }
    
    .search-btn {
        padding: 0.75rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .form-actions {
        margin-top: 1.5rem;
    }
    
    .calculate-btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
    
    .time-value {
        font-size: 1.5rem;
    }
    
    .machine-time .time {
        font-size: 1.2rem;
    }
}

/* Error States */
.form-group.error input,
.form-group.error select {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Loading States */
.calculate-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.calculate-btn.loading::after {
    content: " ...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: " ."; }
    40% { content: " .."; }
    60%, 100% { content: " ..."; }
}
