/**
 * Ultra Fast Quote - Frontend Styles
 */

/* Form Wrapper */
.ufq-form-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.ufq-form-container {
    position: relative;
}

/* Row and Column Layout */
.ufq-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.ufq-form-row > div {
    padding: 0 15px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Issue Input Wrapper */
.ufq-input-wrapper {
    position: relative;
}

/* Smart Editor (ContentEditable) */
.ufq-smart-editor {
    width: 100%;
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.3s ease;
    background: #fff;
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow-y: auto;
}

.ufq-smart-editor:focus {
    outline: none;
    border-color: #007bff;
}

.ufq-smart-editor:empty:before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
}

/* Desktop: absolute positioning when expanded */
@media (min-width: 768px) {
    .ufq-smart-editor.expanded {
        position: absolute;
        z-index: 999;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

/* Mobile: relative positioning (pushes content down) */
@media (max-width: 767px) {
    .ufq-smart-editor.expanded {
        position: relative;
    }
}

/* Bold formatting for detected URL, email, phone */
.ufq-smart-editor .ufq-detected-url,
.ufq-smart-editor .ufq-detected-email,
.ufq-smart-editor .ufq-detected-phone {
    font-weight: bold;
    color: #007bff;
    display: inline;
    cursor: text;
}

.ufq-smart-editor .ufq-detected-url::selection,
.ufq-smart-editor .ufq-detected-email::selection,
.ufq-smart-editor .ufq-detected-phone::selection {
    background: #b3d7ff;
}

/* Smart tooltip */
.ufq-smart-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 8px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ufq-smart-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    border-color: #333 transparent transparent transparent;
}

/* Textarea (disguised as input) - Classic Mode */
.ufq-issue-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    transition: border-color 0.3s ease;
    line-height: 1.5;
    min-height: 48px;
}

.ufq-issue-input:focus {
    outline: none;
    border-color: #007bff;
}

.ufq-issue-input::placeholder {
    color: #999;
}

/* Tooltip */
.ufq-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 8px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ufq-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    border-color: #333 transparent transparent transparent;
}

/* Dropdown */
.ufq-dropdown {
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: -1px;
}

/* Desktop: absolute positioning */
@media (min-width: 768px) {
    .ufq-dropdown {
        position: absolute;
        top: 79px;
    }
    
    /* Make textarea expand without pushing content */
    .ufq-issue-input.expanded {
        position: absolute;
        z-index: 999;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

/* Mobile: relative positioning */
@media (max-width: 767px) {
    .ufq-dropdown {
        position: relative;
        max-width: 100% !important;
    }
    
    /* Allow textarea to push content on mobile */
    .ufq-issue-input.expanded {
        position: relative;
    }
}

/* Service Items */
.ufq-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.ufq-service-item:last-child {
    border-bottom: none;
}

.ufq-service-item:hover {
    background-color: #f8f9fa;
}

.ufq-service-item.active {
    background-color: #e9ecef;
}

.ufq-service-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    padding-right: 15px;
}

.ufq-service-price {
    font-size: 14px;
    font-weight: 600;
    color: #007bff;
    white-space: nowrap;
}

/* Email Input */
.ufq-email-input,
.ufq-contact-input,
.ufq-url-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.ufq-email-input:focus,
.ufq-contact-input:focus,
.ufq-url-input:focus {
    outline: none;
    border-color: #007bff;
}

.ufq-email-input::placeholder,
.ufq-contact-input::placeholder,
.ufq-url-input::placeholder {
    color: #999;
}

/* Submit Button */
.ufq-submit-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ufq-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ufq-submit-btn:active {
    transform: translateY(0);
}

.ufq-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Terms Text */
.ufq-terms-text {
    font-size: 12px;
    opacity: 0.5;
    margin: 0;
    text-align: left;
}

.ufq-terms-row {
    margin: 0 -15px;
}

/* Message Display */
.ufq-message {
    padding: 12px 15px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.ufq-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ufq-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading State */
.ufq-submit-btn.loading {
    position: relative;
    color: transparent;
}

.ufq-submit-btn.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ufq-spin 0.6s linear infinite;
}

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

/* Responsive Adjustments */
@media (min-width: 768px) {
    .col-md-7 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }
    
    .col-md-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }
    
    .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .col-md-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
}

@media (max-width: 767px) {
    .ufq-form-row > div {
        margin-bottom: 10px;
    }
    
    .ufq-submit-btn {
        margin-top: 5px;
    }
    
    .ufq-tooltip {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Utility Classes */
.mb-3 {
    margin-bottom: 1rem;
}

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

/* Custom Button Styles (from original template) */
.orange_bcg {
    background-color: #ff6b35;
}

.black_txt {
    color: #000;
}

.white_txt {
    color: #fff;
}

.btn {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    user-select: none;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}
