/**
 * Frontend Styles for Chemist Pulse Surveys
 * 
 * @package ChemistPulseSurveys
 * @since 1.0.0
 */

/* Survey Form Container */
.cps-survey-container {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.cps-survey-header {
    background: #f8f9fa;
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.cps-survey-title {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}

.cps-survey-description {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
}

.cps-survey-form {
    padding: 30px;
}

/* Respondent Information Section */
.cps-respondent-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
}

.cps-respondent-section h3 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

.cps-form-group {
    margin-bottom: 20px;
}

.cps-form-group:last-child {
    margin-bottom: 0;
}

.cps-form-label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
}

.cps-form-label.required::after {
    content: " *";
    color: #dc3545;
}

.cps-form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.cps-form-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

.cps-form-input.error {
    border-color: #dc3545;
}

/* Survey Questions */
.cps-questions-section {
    margin-bottom: 30px;
}

.cps-question {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
}

.cps-question:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cps-question-text {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.cps-question-required .cps-question-text::after {
    content: " *";
    color: #dc3545;
}

/* Radio Button Styles */
.cps-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cps-radio-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cps-radio-option:hover {
    background: #e9ecef;
    border-color: #007cba;
}

.cps-radio-option input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.cps-radio-option label {
    margin: 0;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
    color: #495057;
}

/* Checkbox Styles */
.cps-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cps-checkbox-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cps-checkbox-option:hover {
    background: #e9ecef;
    border-color: #007cba;
}

.cps-checkbox-option input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.cps-checkbox-option label {
    margin: 0;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
    color: #495057;
}

/* Text Input Styles */
.cps-text-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
    resize: vertical;
    min-height: 100px;
}

.cps-text-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

/* Submit Button */
.cps-submit-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.cps-submit-button {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 15px 40px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 180px;
}

.cps-submit-button:hover {
    background: #005a87;
}

.cps-submit-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.cps-submit-button.loading {
    position: relative;
    color: transparent;
}

.cps-submit-button.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: cps-spin 1s ease-in-out infinite;
}

@keyframes cps-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Messages */
.cps-message {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.cps-message.success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.cps-message.error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #721c24;
}

.cps-message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #055160;
}

/* Thank You Message */
.cps-thank-you {
    text-align: center;
    padding: 40px 30px;
}

.cps-thank-you h2 {
    color: #28a745;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.cps-thank-you p {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

.cps-submission-id {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0 0 0;
    font-family: monospace;
    font-size: 14px;
    color: #495057;
}

/* Survey Results/Reports */
.cps-results-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 30px;
    text-align: center;
}

.cps-results-title {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.cps-results-description {
    margin: 0 0 30px 0;
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
}

.cps-download-button {
    display: inline-block;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.cps-download-button:hover {
    background: #218838;
    color: #fff;
    text-decoration: none;
}

.cps-no-report {
    color: #6c757d;
    font-style: italic;
}

/* Survey Expired/Closed */
.cps-survey-closed {
    text-align: center;
    padding: 40px 30px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.cps-survey-closed h2 {
    color: #6c757d;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.cps-survey-closed p {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

/* Error States */
.cps-error-message {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.cps-field-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cps-survey-container {
        margin: 0 15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .cps-survey-header {
        padding: 20px;
    }
    
    .cps-survey-title {
        font-size: 20px;
    }
    
    .cps-survey-description {
        font-size: 14px;
    }
    
    .cps-survey-form {
        padding: 20px;
    }
    
    .cps-respondent-section {
        padding: 15px;
    }
    
    .cps-form-input,
    .cps-text-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .cps-radio-option,
    .cps-checkbox-option {
        padding: 10px 12px;
    }
    
    .cps-submit-button {
        padding: 12px 30px;
        font-size: 15px;
        min-width: 150px;
    }
    
    .cps-results-container {
        margin: 0 15px;
        padding: 20px;
    }
    
    .cps-results-title {
        font-size: 20px;
    }
    
    .cps-download-button {
        padding: 12px 25px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .cps-survey-header {
        padding: 15px;
    }
    
    .cps-survey-form {
        padding: 15px;
    }
    
    .cps-respondent-section {
        padding: 12px;
    }
    
    .cps-radio-group,
    .cps-checkbox-group {
        gap: 8px;
    }
    
    .cps-radio-option,
    .cps-checkbox-option {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .cps-submit-button {
        width: 100%;
        padding: 12px;
    }
}

/* Print Styles */
@media print {
    .cps-survey-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cps-submit-section {
        display: none;
    }
}