/* Crossword Bonus Form Styles */
.cbf-container {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Roboto', Arial, sans-serif;
}

.cbf-header {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.cbf-header h2 {
    color: #1a73e8;
    font-size: 2rem;
    margin: 0 0 10px 0;
    font-weight: 400;
}

.cbf-description {
    color: #5f6368;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.cbf-section {
    margin-bottom: 32px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 24px;
}

.cbf-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cbf-question {
    margin-bottom: 24px;
}

.cbf-label {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 8px;
    line-height: 1.4;
}

.cbf-section-title {
    font-size: 16px;
    font-weight: 400;
    color: #202124;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.required {
    color: #d93025;
    font-weight: 400;
}

.cbf-input,
.cbf-textarea {
    width: 100%;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.cbf-input:focus,
.cbf-textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}

.cbf-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox Styles */
.cbf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cbf-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cbf-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.cbf-checkbox-label {
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    line-height: 1.4;
    margin: 0;
    flex: 1;
}

.cbf-checkbox-counter {
    margin-top: 16px;
    font-size: 12px;
    color: #5f6368;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e8eaed;
}

.cbf-checkbox-counter.error {
    background: #fce8e6;
    border-color: #d93025;
    color: #d93025;
}

/* Radio Button Styles */
.cbf-rating-group,
.cbf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cbf-radio-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cbf-radio {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.cbf-radio-label {
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    margin: 0;
}

/* Horizontal Rating Styles */
.cbf-rating-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 0;
}

.cbf-rating-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.cbf-radio-rating {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #1a73e8;
}

.cbf-rating-number {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    margin: 0;
    text-align: center;
    min-width: 20px;
    transition: color 0.2s ease;
}

.cbf-rating-item:hover .cbf-rating-number {
    color: #1a73e8;
}

.cbf-rating-item input[type="radio"]:checked + .cbf-rating-number {
    color: #1a73e8;
    font-weight: 600;
}

/* Submit Button */
.cbf-submit-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 16px;
}

.cbf-submit-btn:hover {
    background: #1557b0;
}

.cbf-submit-btn:disabled {
    background: #dadce0;
    cursor: not-allowed;
}

/* Submitted button state */
.cbf-submit-btn.submitted {
    background: #00a32a !important;
    border-color: #00a32a !important;
    color: white !important;
    cursor: default !important;
}

.cbf-submit-btn.submitted:hover {
    background: #00a32a !important;
}

/* Loading Indicator */
.cbf-loading {
    display: inline-flex;
    align-items: center;
    color: #5f6368;
    font-size: 14px;
}

.cbf-loading span {
    margin-left: 8px;
}

.cbf-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e8eaed;
    border-top: 2px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Messages */
.cbf-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.cbf-message.success {
    background: #e8f5e8;
    border: 1px solid #34a853;
    color: #137333;
}

.cbf-message.error {
    background: #fce8e6;
    border: 1px solid #d93025;
    color: #d93025;
}

.cbf-score {
    font-weight: 500;
    font-size: 16px;
    margin-top: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cbf-container {
        margin: 10px;
        padding: 16px;
    }
    
    .cbf-header h2 {
        font-size: 1.5rem;
    }
    
    .cbf-radio-item,
    .cbf-checkbox-item {
        align-items: flex-start;
    }
    
    .cbf-radio,
    .cbf-checkbox {
        margin-top: 2px;
    }
    
    /* Responsive rating layout */
    .cbf-rating-horizontal {
        max-width: 100%;
        gap: 2px;
        padding: 15px 5px;
    }
    
    .cbf-rating-item {
        gap: 6px;
    }
    
    .cbf-radio-rating {
        width: 18px;
        height: 18px;
    }
    
    .cbf-rating-number {
        font-size: 13px;
    }
}

/* Focus styles for accessibility */
.cbf-checkbox:focus,
.cbf-radio:focus,
.cbf-radio-rating:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.cbf-submit-btn:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Validation styles */
.cbf-input:invalid,
.cbf-textarea:invalid {
    border-color: #d93025;
}

.cbf-input:invalid:focus,
.cbf-textarea:invalid:focus {
    box-shadow: 0 0 0 1px #d93025;
}

/* Print Summary Styles */
.cbf-print-summary {
    margin-top: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.cbf-print-actions {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.cbf-print-btn {
    background: #34a853;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cbf-print-btn:hover {
    background: #2d8f47;
}

.cbf-close-btn {
    background: #5f6368;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cbf-close-btn:hover {
    background: #4a4d52;
}

.cbf-print-content {
    padding: 20px;
}

.print-header {
    border-bottom: 2px solid #1a73e8;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.print-header h2 {
    color: #1a73e8;
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.print-header p {
    margin: 5px 0;
    color: #5f6368;
    font-size: 14px;
}

.print-section {
    margin-bottom: 25px;
    page-break-inside: avoid;
}

.print-section h3 {
    color: #202124;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

.print-section ol,
.print-section ul {
    margin: 0;
    padding-left: 20px;
}

.print-section li {
    margin-bottom: 10px;
    line-height: 1.4;
}

.comments-box {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* Print-specific styles */
@media print {
    .cbf-print-actions {
        display: none !important;
    }
    
    .cbf-print-summary {
        border: none;
        box-shadow: none;
        margin: 0;
    }
    
    .cbf-print-content {
        padding: 0;
    }
    
    .print-section {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .print-header {
        border-bottom: 2px solid #000;
    }
    
    .print-header h2 {
        color: #000;
    }
    
    .print-section h3 {
        color: #000;
        border-bottom: 1px solid #000;
    }
    
    .comments-box {
        border: 1px solid #000;
        background: #f5f5f5;
    }
}

/* Auto-save indicator */
.cbf-autosave-indicator.visible {
    opacity: 1;
}

/* Print Styles */
@media print {
    /* Hide everything by default when printing */
    body * {
        visibility: hidden;
    }
    
    /* Show only the print summary content */
    .cbf-print-summary,
    .cbf-print-summary *,
    .cbf-print-content,
    .cbf-print-content * {
        visibility: visible;
    }
    
    /* Position the print summary at the top with no wasted space */
    .cbf-print-summary {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: white;
    }
    
    /* Hide the print actions (buttons) during print */
    .cbf-print-actions {
        display: none !important;
    }
    
    /* Compact print formatting */
    .cbf-print-content {
        font-size: 11pt;
        line-height: 1.2;
        color: black;
        margin: 0;
        padding: 15pt;
    }
    
    /* Print header styling */
    .print-header {
        border-bottom: 2pt solid #000;
        margin-bottom: 15pt;
        padding-bottom: 10pt;
        text-align: center;
    }
    
    .print-header h2 {
        color: black;
        margin: 0 0 5pt 0;
        font-size: 16pt;
        font-weight: bold;
    }
    
    .print-header .website {
        font-size: 12pt;
        margin: 2pt 0;
        font-weight: bold;
    }
    
    .print-header .date {
        font-size: 10pt;
        margin: 2pt 0;
        color: #333;
    }
    
    /* Compact section styling */
    .cbf-print-content h3 {
        font-size: 12pt;
        margin: 10pt 0 5pt 0;
        color: black;
        border-bottom: 1pt solid #333;
        padding-bottom: 2pt;
        page-break-after: avoid;
    }
    
    .print-section {
        margin-bottom: 12pt;
        page-break-inside: avoid;
    }
    
    /* Compact list styling */
    .cbf-print-content ol,
    .cbf-print-content ul {
        margin: 5pt 0;
        padding-left: 15pt;
    }
    
    .cbf-print-content li {
        margin-bottom: 3pt;
        line-height: 1.2;
        font-size: 10pt;
    }
    
    /* Compact table styling */
    .cbf-print-content table {
        width: 100%;
        border-collapse: collapse;
        margin: 5pt 0;
        font-size: 10pt;
    }
    
    .cbf-print-content th,
    .cbf-print-content td {
        border: 1pt solid #333;
        padding: 4pt 6pt;
        text-align: left;
    }
    
    .cbf-print-content th {
        background: #f0f0f0;
        font-weight: bold;
        font-size: 10pt;
    }
    
    /* Compact comments box */
    .comments-box {
        background: #f8f8f8;
        border: 1pt solid #333;
        padding: 8pt;
        margin: 5pt 0;
        font-size: 10pt;
        line-height: 1.3;
    }
    
    /* Two-column layout for answers to save space */
    .answers-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10pt;
        margin: 5pt 0;
    }
    
    .answer-item {
        font-size: 10pt;
        margin: 2pt 0;
    }
    
    /* Ensure no page breaks in key sections */
    .user-info,
    .score-section,
    .rating-section {
        page-break-inside: avoid;
    }
    
    /* Remove excessive margins and padding */
    .cbf-print-content p {
        margin: 3pt 0;
    }
    
    .cbf-print-content div {
        margin: 0;
    }
} 