/**
 * AI Internship Builder
 * Public-facing CSS
 */

/* Form Container */
.aib-form-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
}

/* Form Title */
.aib-form-title {
    text-align: center;
    margin-bottom: 20px;
    color: #2271b1;
    font-size: 24px;
    font-weight: 600;
}

/* Form Steps Navigation */
.aib-steps-container {
    margin-bottom: 30px;
}

.aib-steps-nav {
    display: flex;
    justify-content: space-between;
    padding: 0;
    list-style: none;
    margin: 0;
    position: relative;
}

.aib-steps-nav::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #e5e5e5;
    z-index: 1;
}

.aib-step-item {
    position: relative;
    z-index: 2;
    flex: 1;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    padding-top: 30px;
    color: #777;
}

.aib-step-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background-color: #e5e5e5;
    border-radius: 50%;
    z-index: 3;
    transition: background-color 0.3s ease;
}

.aib-step-item::after {
    content: attr(data-step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
    color: #fff;
    z-index: 4;
}

.aib-step-item.active::before {
    background-color: #2271b1;
}

.aib-step-item.completed::before {
    background-color: #46b450;
}

@media (max-width: 768px) {
    .aib-step-item {
        font-size: 0;
    }
    
    .aib-steps-nav::before {
        top: 14px;
    }
    
    .aib-step-item::before {
        width: 25px;
        height: 25px;
    }
    
    .aib-step-item::after {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 12px;
    }
    
    .aib-step-item {
        padding-top: 25px;
    }
}

/* Form Content */
.aib-step-content {
    display: none;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.aib-step-content.active {
    display: block;
}

.aib-step-content h3 {
    margin-top: 0;
    color: #2271b1;
    font-size: 20px;
    font-weight: 500;
}

.aib-step-description {
    margin-bottom: 20px;
    color: #666;
    font-style: italic;
}

/* Form Rows */
.aib-form-row {
    margin-bottom: 20px;
}

.aib-form-row-half {
    width: calc(50% - 10px);
    display: inline-block;
    vertical-align: top;
}

.aib-form-row-half:nth-child(odd) {
    margin-right: 20px;
}

@media (max-width: 600px) {
    .aib-form-row-half {
        width: 100%;
    }
    
    .aib-form-row-half:nth-child(odd) {
        margin-right: 0;
    }
}

/* Form Labels */
.aib-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.aib-form-row label .required {
    color: #d63638;
}

/* Form Inputs */
.aib-form-row input[type="text"],
.aib-form-row input[type="date"],
.aib-form-row input[type="number"],
.aib-form-row select,
.aib-form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.aib-form-row input.error,
.aib-form-row select.error,
.aib-form-row textarea.error {
    border-color: #d63638;
    background-color: rgba(214, 54, 56, 0.05);
}

/* Form Buttons */
.aib-form-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.aib-next-button,
.aib-prev-button,
.aib-submit-button,
.aib-ai-button,
.aib-export-button,
.aib-new-internship-button {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
}

.aib-next-button,
.aib-submit-button {
    background-color: #2271b1;
    color: #fff;
}

.aib-next-button:hover,
.aib-submit-button:hover {
    background-color: #135e96;
}

.aib-prev-button {
    background-color: #f0f0f1;
    color: #2c3338;
}

.aib-prev-button:hover {
    background-color: #e5e5e5;
}

.aib-ai-button {
    background-color: #9622b1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aib-ai-button:hover {
    background-color: #7a1d91;
}

.aib-ai-icon {
    margin-right: 8px;
    font-size: 18px;
}

.aib-export-button {
    background-color: #2271b1;
    color: #fff;
    margin: 5px;
}

.aib-export-button:hover {
    background-color: #135e96;
}

.aib-new-internship-button {
    background-color: #46b450;
    color: #fff;
    margin-top: 20px;
}

.aib-new-internship-button:hover {
    background-color: #399e43;
}

@media (max-width: 500px) {
    .aib-form-buttons {
        flex-direction: column;
    }
    
    .aib-next-button,
    .aib-prev-button,
    .aib-submit-button {
        margin-bottom: 10px;
        text-align: center;
    }
}

/* AI Recommendations */
.aib-ai-recommendations {
    margin-top: 10px;
    margin-bottom: 15px;
}

.aib-ai-loading {
    padding: 15px;
    background-color: #f0f0f1;
    border-radius: 4px;
    text-align: center;
    color: #666;
}

.aib-ai-error {
    padding: 15px;
    background-color: #fcf3f3;
    border-left: 4px solid #d63638;
    color: #d63638;
}

.aib-ai-result {
    background-color: #f0f7fb;
    border-radius: 6px;
    overflow: hidden;
}

.aib-ai-result-header {
    background-color: #2271b1;
    color: #fff;
    padding: 10px 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.aib-ai-result-content {
    padding: 15px;
    color: #333;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.aib-use-recommendation {
    background-color: #46b450;
    color: #fff;
    border: none;
    padding: 8px 15px;
    margin: 0 15px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.aib-use-recommendation:hover {
    background-color: #399e43;
}

/* Review */
.aib-review-container {
    margin-bottom: 30px;
}

.aib-review-section {
    margin-bottom: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.aib-review-section h4 {
    margin-top: 0;
    color: #2271b1;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
}

.aib-review-item {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.aib-review-label {
    font-weight: 500;
    width: 120px;
    color: #666;
}

.aib-review-content {
    white-space: pre-line;
    line-height: 1.6;
}

/* Loading Spinner */
.aib-loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.aib-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Success Message */
.aib-success-message {
    text-align: center;
    padding: 30px;
}

.aib-success-icon {
    background-color: #46b450;
    color: white;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    font-size: 30px;
    margin: 0 auto 20px;
}

.aib-export-options {
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

/* Divi Compatibility */
.et-db #et-boc .et-l .aib-form-container {
    font-family: inherit;
}

.et-db #et-boc .et-l .aib-form-container input[type="text"],
.et-db #et-boc .et-l .aib-form-container input[type="date"],
.et-db #et-boc .et-l .aib-form-container input[type="number"],
.et-db #et-boc .et-l .aib-form-container select,
.et-db #et-boc .et-l .aib-form-container textarea {
    padding: 10px;
    width: 100%;
    background-color: #fff;
}

.et-db #et-boc .et-l .aib-next-button,
.et-db #et-boc .et-l .aib-prev-button,
.et-db #et-boc .et-l .aib-submit-button {
    padding: 10px 20px;
    border-radius: 4px;
}

/* Clear floats fix for Divi */
.et-db #et-boc .et-l .aib-form-container .aib-form-row:after {
    content: "";
    display: table;
    clear: both;
}
