/* RCK Ankiety - Frontend Styles */
/* Styl dopasowany do https://darkrwi.ksr.zgo.pl/ankieta/ */

.rck-survey-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Nagłówek ankiety */
.rck-survey-header {
    margin-bottom: 30px;
    text-align: center;
}

.rck-survey-title {
    font-size: 2.2em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 3px solid #c32c2c;
    padding-bottom: 10px;
    display: inline-block;
}

.rck-survey-description {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c32c2c;
}

/* Pasek postępu */
.rck-progress-bar {
    background: #ecf0f1;
    border-radius: 25px;
    height: 8px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.rck-progress-fill {
    background: linear-gradient(90deg, #c32c2c, #a02424);
    height: 100%;
    border-radius: 25px;
    transition: width 0.3s ease;
}

.rck-progress-text {
    font-size: 0.9em;
    color: #7f8c8d;
    text-align: center;
    margin-top: 5px;
    display: block;
}

/* Formularz ankiety */
.rck-survey-form {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Kontener pytania */
.rck-question-container {
    border-bottom: 1px solid #ecf0f1;
    padding: 25px;
    transition: background-color 0.2s ease;
}

.rck-question-container:last-child {
    border-bottom: none;
}

.rck-question-container:hover {
    background-color: #fafbfc;
}

/* Nagłówek pytania */
.rck-question-header {
    margin-bottom: 20px;
}

.rck-question-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.rck-question-number {
    background: #c32c2c;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

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

.rck-radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.rck-radio-option:hover {
    border-color: #c32c2c;
    background: #f8f9fa;
}

.rck-radio-option input[type="radio"] {
    display: none;
}

.rck-radio-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #bdc3c7;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rck-radio-option input[type="radio"]:checked + .rck-radio-checkmark {
    border-color: #c32c2c;
    background: #c32c2c;
}

.rck-radio-option input[type="radio"]:checked + .rck-radio-checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.rck-radio-text {
    font-size: 1em;
    color: #2c3e50;
    flex: 1;
}

.rck-radio-option input[type="radio"]:checked ~ .rck-radio-text {
    font-weight: 600;
    color: #a02424;
}

/* Opcje checkbox */
.rck-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rck-checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.rck-checkbox-option:hover {
    border-color: #c32c2c;
    background: #f8f9fa;
}

.rck-checkbox-option input[type="checkbox"] {
    display: none;
}

.rck-checkbox-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rck-checkbox-option input[type="checkbox"]:checked + .rck-checkbox-checkmark {
    border-color: #c32c2c;
    background: #c32c2c;
}

.rck-checkbox-option input[type="checkbox"]:checked + .rck-checkbox-checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.rck-checkbox-text {
    font-size: 1em;
    color: #2c3e50;
    flex: 1;
}

.rck-checkbox-option input[type="checkbox"]:checked ~ .rck-checkbox-text {
    font-weight: 600;
    color: #a02424;
}

/* Pole tekstowe */
.rck-text-group {
    margin-top: 10px;
}

.rck-text-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease;
}

.rck-text-input:focus {
    outline: none;
    border-color: #c32c2c;
    box-shadow: 0 0 0 3px rgba(195, 44, 44, 0.1);
}

.rck-text-input::placeholder {
    color: #95a5a6;
}

/* Stopka formularza */
.rck-survey-footer {
    padding: 30px 25px;
    background: #f8f9fa;
    text-align: center;
}

.rck-submit-btn {
    background: #c32c2c;
    color: white;
    border: 2px solid #c32c2c;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rck-submit-btn:hover {
    background: white;
    color: #c32c2c;
    border-color: #c32c2c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(195, 44, 44, 0.2);
}

.rck-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rck-submit-btn:disabled {
    background: #bdc3c7;
    color: #7f8c8d;
    border-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.rck-submit-btn:disabled:hover {
    background: #bdc3c7;
    color: #7f8c8d;
    border-color: #bdc3c7;
    transform: none;
    box-shadow: none;
}

.rck-btn-loading {
    display: none;
}

.rck-submit-btn.loading .rck-btn-text {
    display: none;
}

.rck-submit-btn.loading .rck-btn-loading {
    display: inline;
}

.rck-submit-btn.loading {
    background: #95a5a6;
    border-color: #95a5a6;
    color: white;
    cursor: wait;
}

/* Komunikaty */
.rck-survey-success,
.rck-survey-error {
    text-align: center;
    padding: 40px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
}

.rck-survey-success {
    background: #d5f4e6;
    border: 2px solid #c32c2c;
    color: #a02424;
}

.rck-survey-error {
    background: #fadbd8;
    border: 2px solid #c32c2c;
    color: #a02424;
}

.rck-success-icon,
.rck-error-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.rck-success-icon {
    color: #c32c2c;
}

.rck-error-icon {
    color: #c32c2c;
}

.rck-survey-success h3,
.rck-survey-error h3 {
    font-size: 1.5em;
    margin: 0 0 10px 0;
}

.rck-survey-success p,
.rck-survey-error p {
    font-size: 1.1em;
    margin: 0;
}

.rck-retry-btn {
    background: white;
    color: #c32c2c;
    border: 2px solid #c32c2c;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    display: inline-block;
}

.rck-retry-btn:hover {
    background: #c32c2c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(195, 44, 44, 0.2);
}

/* Komunikaty błędów */
.rck-error {
    background: #fadbd8;
    border: 2px solid #c32c2c;
    color: #a02424;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
}

/* Sekcja wyników ankiety */
.rck-survey-results {
    display: none;
    margin-top: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.rck-results-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border-left: 6px solid #c32c2c;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rck-results-header .rck-success-icon {
    font-size: 4em;
    color: #c32c2c;
    margin-bottom: 15px;
    display: block;
    text-shadow: 0 2px 4px rgba(195, 44, 44, 0.3);
}

.rck-results-header h2 {
    color: #c32c2c;
    margin: 0 0 10px 0;
    font-size: 2em;
    font-weight: 700;
}

.rck-results-header h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.3em;
    font-weight: 600;
    font-style: italic;
}

.rck-results-header p {
    color: #666;
    margin: 0;
    font-size: 1.1em;
}

.rck-results-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.rck-result-question {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rck-result-question:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.rck-result-question h4 {
    color: #2c3e50;
    margin: 0 0 25px 0;
    font-size: 1.3em;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #c32c2c;
}

.rck-result-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}

.rck-result-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafafa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #eee;
}

.rck-result-table {
    overflow-x: auto;
}

.rck-result-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rck-result-table th {
    background: #c32c2c;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rck-result-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95em;
}

.rck-result-table tr:last-child td {
    border-bottom: none;
}

.rck-result-table tr:hover {
    background: #f8f9fa;
}

.rck-user-answer {
    background: #fff3cd !important;
    border-left: 4px solid #c32c2c !important;
    font-weight: 600;
}

.rck-user-answer:hover {
    background: #ffeaa7 !important;
}

.rck-user-checkmark {
    color: #c32c2c;
    font-weight: bold;
    font-size: 1.2em;
}

/* Responsywność dla wyników */
@media (max-width: 768px) {
    .rck-results-header {
        padding: 20px 15px;
    }
    
    .rck-results-header h2 {
        font-size: 1.6em;
    }
    
    .rck-results-header h3 {
        font-size: 1.1em;
    }
    
    .rck-result-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .rck-result-chart-container {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .rck-result-question {
        padding: 20px 15px;
    }
    
    .rck-result-table {
        font-size: 0.9em;
    }
    
    .rck-result-table th,
    .rck-result-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .rck-results-header .rck-success-icon {
        font-size: 3em;
    }
    
    .rck-results-header h2 {
        font-size: 1.4em;
    }
    
    .rck-result-chart-container {
        max-width: 250px;
        padding: 15px;
    }
    
    .rck-result-table th {
        font-size: 0.8em;
        padding: 6px 8px;
    }
    
    .rck-result-table td {
        font-size: 0.85em;
        padding: 6px 8px;
    }
}

/* Responsywność */
@media (max-width: 768px) {
    .rck-survey-container {
        padding: 15px;
        margin: 0 10px;
    }
    
    .rck-survey-title {
        font-size: 1.8em;
    }
    
    .rck-question-container {
        padding: 20px 15px;
    }
    
    .rck-question-title {
        font-size: 1.2em;
    }
    
    .rck-radio-option,
    .rck-checkbox-option {
        padding: 10px 12px;
    }
    
    .rck-submit-btn {
        padding: 12px 30px;
        font-size: 1em;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .rck-survey-title {
        font-size: 1.5em;
    }
    
    .rck-question-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rck-question-number {
        align-self: flex-start;
    }
    
    .rck-radio-option,
    .rck-checkbox-option {
        padding: 8px 10px;
    }
}

/* Animacje */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rck-question-container {
    animation: fadeInUp 0.3s ease-out;
}

/* Styl tabelowy podobny do oryginalnej strony */
.rck-style-table .rck-survey-form {
    border: 1px solid #ddd;
    border-radius: 0;
    box-shadow: none;
}

.rck-style-table .rck-question-container {
    border-bottom: 1px solid #ddd;
    padding: 0;
    background: white;
}

.rck-style-table .rck-question-container:hover {
    background: #f9f9f9;
}

.rck-style-table .rck-question-header {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    margin: 0;
}

.rck-style-table .rck-question-title {
    font-size: 1.1em;
    padding: 15px 20px;
    margin: 0;
    border-left: 4px solid #c32c2c;
    font-weight: 600;
}

.rck-style-table .rck-question-number {
    background: transparent;
    color: #c32c2c;
    font-weight: bold;
    width: auto;
    height: auto;
    border-radius: 0;
    margin-right: 10px;
}

.rck-style-table .rck-radio-group,
.rck-style-table .rck-checkbox-group {
    display: block;
    margin: 0;
    padding: 15px 20px;
}

.rck-style-table .rck-radio-option,
.rck-style-table .rck-checkbox-option {
    display: flex;
    align-items: center;
    border: none;
    border-radius: 0;
    padding: 8px 0;
    background: transparent;
    margin-bottom: 8px;
}

.rck-style-table .rck-radio-option:last-child,
.rck-style-table .rck-checkbox-option:last-child {
    margin-bottom: 0;
}

.rck-style-table .rck-radio-option:hover,
.rck-style-table .rck-checkbox-option:hover {
    background: rgba(195, 44, 44, 0.05);
    border-radius: 4px;
}

.rck-style-table .rck-radio-text,
.rck-style-table .rck-checkbox-text {
    padding: 0;
    margin-left: 8px;
    border: none;
    font-size: 0.95em;
    color: #333;
}

.rck-style-table .rck-radio-checkmark,
.rck-style-table .rck-checkbox-checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #999;
    margin: 0;
}

.rck-style-table .rck-radio-checkmark {
    border-radius: 50%;
}

.rck-style-table .rck-checkbox-checkmark {
    border-radius: 3px;
}

.rck-style-table .rck-radio-option input[type="radio"]:checked + .rck-radio-checkmark {
    border-color: #c32c2c;
    background: #c32c2c;
}

.rck-style-table .rck-checkbox-option input[type="checkbox"]:checked + .rck-checkbox-checkmark {
    border-color: #c32c2c;
    background: #c32c2c;
}

/* Ukryj pasek postępu w stylu table */
.rck-style-table .rck-progress-bar,
.rck-style-table .rck-progress-text {
    display: none;
}

/* Zmień tytuł w stylu table */
.rck-style-table .rck-survey-title {
    font-size: 1.8em;
    color: #333;
    border-bottom: 2px solid #c32c2c;
    text-align: left;
    margin-bottom: 20px;
}

.rck-style-table .rck-survey-description {
    background: #f8f9fa;
    border-left: 4px solid #c32c2c;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 1em;
}

/* Przycisk submit w stylu table */
.rck-style-table .rck-submit-btn {
    background: #c32c2c;
    color: white;
    border: 2px solid #c32c2c;
    padding: 10px 25px;
    font-size: 0.95em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 3px;
    min-width: 150px;
}

.rck-style-table .rck-submit-btn:hover {
    background: white;
    color: #c32c2c;
    border-color: #c32c2c;
}

/* Alternatywny styl - prostszy */
.rck-style-simple .rck-survey-container {
    background: white;
    border: 1px solid #ddd;
    padding: 20px;
}

.rck-style-simple .rck-survey-title {
    border-bottom: 2px solid #333;
    color: #333;
}

.rck-style-simple .rck-question-container {
    border: none;
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

.rck-style-simple .rck-radio-option,
.rck-style-simple .rck-checkbox-option {
    border: 1px solid #ddd;
    margin-bottom: 5px;
    background: #fafafa;
}

.rck-style-simple .rck-radio-option:hover,
.rck-style-simple .rck-checkbox-option:hover {
    background: #f0f0f0;
}

.rck-style-simple .rck-submit-btn {
    background: #333;
    border-radius: 4px;
}

.rck-style-simple .rck-submit-btn:hover {
    background: #555;
}
