/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #1a1a1a;
    line-height: 1.6;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #cc0000;
}

h1 {
    font-size: 2.5em;
    color: #cc0000;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2em;
    color: #444444;
    margin-bottom: 10px;
}

/* Question Sections */
.question-section {
    margin-bottom: 40px;
    padding: 30px;
    background-color: #fafafa;
    border-radius: 8px;
    border-left: 4px solid #cc0000;
}

.question-section h2 {
    color: #1a1a1a;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.required {
    color: #cc0000;
    font-weight: bold;
}

.instruction {
    color: #666666;
    font-style: italic;
    margin-bottom: 20px;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.checkbox-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-column label,
.checkbox-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.checkbox-column label:hover,
.checkbox-list label:hover {
    background-color: #f0f0f0;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #cc0000;
}

/* Radio Buttons */
input[type="radio"] {
    margin-right: 5px;
    cursor: pointer;
    accent-color: #cc0000;
}

/* Text Inputs and Textareas */
.text-input,
.textarea-input {
    width: 100%;
    padding: 12px;
    background-color: #ffffff;
    border: 2px solid #cccccc;
    border-radius: 5px;
    color: #1a1a1a;
    font-size: 1em;
    font-family: inherit;
    margin-top: 10px;
    transition: border-color 0.3s;
}

.text-input:focus,
.textarea-input:focus {
    outline: none;
    border-color: #cc0000;
}

.textarea-input {
    resize: vertical;
    min-height: 100px;
}

.other-field,
.textarea-field {
    margin-top: 20px;
}

.textarea-field label {
    display: block;
    margin-bottom: 10px;
    color: #444444;
}

/* Frequency Table */
.frequency-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.frequency-table th,
.frequency-table td {
    padding: 15px;
    text-align: center;
    border: 1px solid #dddddd;
}

.frequency-table th {
    background-color: #cc0000;
    color: #ffffff;
    font-weight: bold;
}

.frequency-table td.format-label {
    text-align: left;
    font-weight: bold;
    background-color: #f5f5f5;
}

.frequency-table tbody tr:hover {
    background-color: #f0f0f0;
}

/* Trust Ratings */
.trust-ratings {
    margin-top: 20px;
}

.trust-row {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.trust-label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.trust-scale {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scale-end {
    font-size: 0.9em;
    color: #666666;
    min-width: 120px;
}

.scale-options {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.scale-options label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.scale-options label:hover {
    background-color: #e0e0e0;
}

.scale-options input[type="radio"] {
    margin: 0 0 3px 0;
}

/* Ranking Interface */
.ranking-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.ranking-sources {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #cccccc;
}

.ranking-sources h3 {
    color: #cc0000;
    margin-bottom: 15px;
}

.ranking-item {
    background-color: #ffffff;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 2px solid #cccccc;
    cursor: move;
    transition: all 0.2s;
    user-select: none;
}

.ranking-item:hover {
    background-color: #f0f0f0;
    border-color: #cc0000;
}

.ranking-item.dragging {
    opacity: 0.5;
}

.ranking-item.hidden {
    display: none;
}

.ranking-drop-zone {
    background-color: #fff5f5;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #cc0000;
}

.ranking-drop-zone h3 {
    color: #cc0000;
    margin-bottom: 20px;
    text-align: center;
}

.rank-slot {
    margin-bottom: 15px;
}

.rank-number {
    display: block;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.rank-drop-area {
    background-color: #ffffff;
    border: 2px dashed #999999;
    border-radius: 5px;
    padding: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
    transition: all 0.2s;
}

.rank-drop-area.drag-over {
    border-color: #cc0000;
    background-color: #fff0f0;
}

.rank-drop-area.filled {
    background-color: #f5f5f5;
    border-style: solid;
    border-color: #cc0000;
    color: #1a1a1a;
}

/* Prize Section */
.prize-section {
    background-color: #fff5f5;
    border-left-color: #ff0000;
}

/* Submit Section */
.submit-section {
    text-align: center;
    margin-top: 40px;
}

.submit-btn {
    background-color: #cc0000;
    color: #ffffff;
    font-size: 1.3em;
    font-weight: bold;
    padding: 15px 60px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3);
}

.submit-btn:hover {
    background-color: #990000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(204, 0, 0, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Thank You Message */
.thank-you-message {
    text-align: center;
    padding: 60px 40px;
    background-color: #fff5f5;
    border-radius: 8px;
    border: 3px solid #cc0000;
}

.thank-you-message h2 {
    color: #cc0000;
    font-size: 2em;
    margin-bottom: 20px;
}

.thank-you-message p {
    font-size: 1.2em;
    color: #444444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .ranking-container {
        grid-template-columns: 1fr;
    }

    .trust-scale {
        flex-direction: column;
        align-items: flex-start;
    }

    .scale-end {
        min-width: auto;
    }

    .scale-options {
        width: 100%;
        justify-content: space-between;
    }

    .frequency-table {
        font-size: 0.9em;
    }

    .frequency-table th,
    .frequency-table td {
        padding: 8px 5px;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #cc0000;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Messages */
.error-message {
    background-color: #fff0f0;
    color: #cc0000;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #cc0000;
    margin-bottom: 20px;
}