/* Advisor Exteriors Roofing Calculator Styles */

:root {
    --primary-blue: #5B9BD5;
    --dark-navy: #1E3A5F;
    --light-blue: #A8D8E8;
    --accent-blue: #4A90C4;
    --light-bg: #F5F9FC;
    --white: #FFFFFF;
    --text-dark: #2C3E50;
    --text-light: #6C757D;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --border: #E0E0E0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--primary-blue) 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 20px;
}

.header h1 {
    color: var(--dark-navy);
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.2em;
}

/* Calculator Section */
.calculator-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 968px) {
    .calculator-section {
        grid-template-columns: 1fr;
    }
}

.calculator-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.calculator-card h2 {
    color: var(--dark-navy);
    margin-bottom: 30px;
    font-size: 1.8em;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-navy);
    font-weight: 600;
    font-size: 1em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--dark-navy);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85em;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-urgent {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 10px;
}

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

.btn-primary:hover {
    background: #15293d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.btn-secondary:hover {
    background: #4a8ac4;
}

.btn-urgent {
    background: var(--danger);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Results Section */
.results {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 3px solid var(--primary-blue);
}

.results h3 {
    color: var(--dark-navy);
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
}

.estimate-range {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .estimate-range {
        grid-template-columns: 1fr;
    }
}

.estimate-box {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--border);
}

.estimate-box.highlight {
    background: var(--dark-navy);
    color: white;
    border-color: var(--dark-navy);
    transform: scale(1.05);
}

.estimate-label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.estimate-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
}

.estimate-details {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.estimate-details ul {
    list-style: none;
    padding-left: 0;
}

.estimate-details li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.estimate-details li:last-child {
    border-bottom: none;
}

.cta-section {
    text-align: center;
    margin-top: 30px;
}

.cta-section h4 {
    color: var(--dark-navy);
    font-size: 1.5em;
    margin-bottom: 10px;
}

.cta-section p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Info Sidebar */
.info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.info-card h3 {
    color: var(--dark-navy);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.info-card.urgency {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.info-card.urgency h3 {
    color: white;
}

.benefits-list,
.included-list {
    list-style: none;
    padding: 0;
}

.benefits-list li,
.included-list li {
    padding: 8px 0;
    color: var(--text-dark);
}

.benefits-list li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--dark-navy);
    border-radius: 50%;
    margin-right: 10px;
}

.included-list li::before {
    content: '✓ ';
    color: var(--success);
    font-weight: bold;
    margin-right: 8px;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
    padding: 30px 0;
    -webkit-overflow-scrolling: touch;
}

.modal.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    min-height: auto;
    overflow: visible;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content.chat-modal {
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: var(--dark-navy);
}

.modal-content h2 {
    color: var(--dark-navy);
    margin-bottom: 10px;
}

.modal-content p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Chat Styles */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 10px;
    margin-bottom: 20px;
    max-height: 400px;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    animation: messageSlide 0.3s;
}

@keyframes messageSlide {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.bot-message {
    background: white;
    border-left: 4px solid var(--dark-navy);
}

.user-message {
    background: var(--dark-navy);
    color: white;
    margin-left: 50px;
}

.message ul {
    margin-top: 10px;
    padding-left: 20px;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    resize: none;
    font-family: inherit;
}

#chatInput:focus {
    outline: none;
    border-color: var(--dark-navy);
}

.chat-input-container .btn-primary {
    width: auto;
    padding: 12px 25px;
    margin-top: 0;
}

/* Floating Chat Button */
.floating-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--dark-navy);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s;
    z-index: 999;
}

.floating-chat-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    background: #15293d;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* HubSpot Form Styling */
.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-blue);
}

.form-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 15px;
}

.modal-content h2 {
    color: var(--dark-navy);
    margin-bottom: 10px;
}

.modal-content p {
    color: var(--text-light);
    margin-bottom: 20px;
}

#hubspotForm {
    width: 100%;
}

#hubspotForm .hs-form {
    font-family: inherit;
}

#hubspotForm .hs-form-field {
    margin-bottom: 20px;
}

#hubspotForm label {
    color: var(--dark-navy);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

#hubspotForm input[type="text"],
#hubspotForm input[type="email"],
#hubspotForm input[type="tel"],
#hubspotForm select,
#hubspotForm textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
}

#hubspotForm input:focus,
#hubspotForm select:focus,
#hubspotForm textarea:focus {
    outline: none;
    border-color: var(--dark-navy);
}

#hubspotForm .hs-button {
    background: var(--dark-navy);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

#hubspotForm .hs-button:hover {
    background: #15293d;
    transform: translateY(-2px);
}

#hubspotForm .hs-error-msgs {
    color: var(--danger);
    font-size: 0.9em;
    margin-top: 5px;
}

#hubspotForm .hs-form-required {
    color: var(--danger);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .calculator-card {
        padding: 25px;
    }
    
    .modal {
        padding: 20px 0;
        overflow-y: auto;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 60px 20px 20px 20px;
        border-radius: 10px;
        overflow: visible;
        min-height: auto;
    }
    
    .close {
        position: absolute;
        font-size: 40px;
        top: 10px;
        right: 10px;
        z-index: 10001;
    }
    
    .floating-chat-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 0.9em;
    }
}
