/* Custom Styles for PDF Analyzer */

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border: none;
    border-radius: 15px;
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
}

.upload-area {
    border: 3px dashed #007bff;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: #0056b3;
    background: #e3f2fd;
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: #28a745;
    background: #d4edda;
}

.upload-content {
    pointer-events: none;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #007bff;
    margin-bottom: 20px;
}

.page-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s ease;
}

.page-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.page-number {
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.progress {
    border-radius: 15px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 15px;
    transition: width 0.3s ease;
}

/* Animation for loading */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    .upload-area {
        padding: 20px 10px;
        min-height: 150px;
    }
    
    .container-fluid {
        padding: 0;
    }
    
    .card {
        margin-bottom: 20px;
    }
}

/* Success and error states */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Custom button styles */
.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
}

/* Card header improvements */
.card-header {
    border-radius: 15px 15px 0 0 !important;
}

/* JSON preview styles */
.json-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-processing {
    background: #ffc107;
    animation: pulse 1.5s infinite;
}

.status-success {
    background: #28a745;
}

.status-error {
    background: #dc3545;
}

/* Edit Mode Styles */
.edit-mode {
    display: none !important;
}

.edit-mode.active {
    display: block !important;
}

.view-mode.hidden {
    display: none !important;
}

.page-card.edit-mode {
    border: 2px dashed #007bff;
    background: #f8f9fa;
}

.page-edit-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

.page-edit-textarea {
    min-height: 80px;
    resize: vertical;
}

.page-delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.page-card {
    position: relative;
}

.page-card.editable:hover .page-delete-btn {
    opacity: 1;
}

.page-delete-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Drag and drop for reordering */
.page-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.page-card.drag-over {
    border-top: 3px solid #007bff;
}

/* Edit form styles */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.edit-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
}

/* Checkbox Row Group Styles */
.checkbox-row-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    padding: 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    align-items: center;
}

.checkbox-row-group .form-check {
    margin: 0;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: #f8f9fa;
    border: 1px solid transparent;
}

.checkbox-row-group .form-check:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    transform: translateY(-1px);
}

.checkbox-row-group .form-check-input {
    margin-top: 0.25em;
    margin-right: 8px;
}

.checkbox-row-group .form-check-label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.checkbox-row-group .form-check-input:checked + .form-check-label {
    color: #007bff;
    font-weight: 600;
}

.checkbox-row-group .form-check:has(.form-check-input:checked) {
    background-color: #e7f3ff;
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

/* Responsive design for checkbox groups */
@media (max-width: 768px) {
    .checkbox-row-group {
        gap: 10px 15px;
    }
    
    .checkbox-row-group .form-check {
        padding: 6px 10px;
    }
}

/* Multiple Choice Questions Styles */
.questions-container {
    min-height: 50px;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 20px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.questions-container:empty::before {
    content: "Henüz soru eklenmemiş. 'Soru Ekle' butonuna tıklayarak başlayın.";
    color: #6c757d;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 30px 0;
}

.questions-container:not(:empty) {
    border-style: solid;
    background: white;
}

.question-item {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-item .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.question-item .card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.question-item .card-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    padding: 12px 20px;
}

.question-item .card-body {
    padding: 20px;
    background: #fff;
}

.choice-item {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.choice-item .input-group-text {
    background: #e9ecef;
    border-color: #ced4da;
    font-weight: 600;
    color: #495057;
    min-width: 45px;
    justify-content: center;
}

.choice-item .form-control {
    border-left: none;
    border-right: none;
}

.choice-item .btn-outline-danger {
    border-left: none;
    border-color: #ced4da;
}

.choice-item .btn-outline-danger:hover {
    border-color: #dc3545;
}

.choices-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.choices-section .btn-outline-primary {
    font-size: 0.875rem;
    padding: 5px 12px;
}

.question-text, .question-hint {
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.question-text:focus, .question-hint:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.choice-text {
    transition: border-color 0.2s ease;
}

.choice-text:focus {
    border-color: #007bff;
    box-shadow: none;
}

/* Responsive adjustments for questions */
@media (max-width: 768px) {
    .question-item .card-header {
        padding: 10px 15px;
    }
    
    .question-item .card-body {
        padding: 15px;
    }
    
    .choices-section {
        padding: 10px;
    }
    
    .choice-item .input-group-text {
        min-width: 40px;
        font-size: 0.875rem;
    }
}

/* Reader Page Preview Styles */
.reader-page-preview {
    transition: all 0.2s ease;
    padding: 15px;
    border-radius: 8px;
    background: #fafbfc;
}

.reader-page-preview:hover {
    background-color: #f1f3f4;
}

.reader-page-preview .form-check-sm .form-check-input {
    margin-top: 0.125rem;
}

.reader-page-preview .form-check-sm .form-check-label {
    font-size: 0.875rem;
    color: #6c757d;
}

.reader-page-preview .form-check-input:checked + .form-check-label {
    color: #007bff;
    font-weight: 500;
}

/* Reader Page Item Styles */
.reader-page-item {
    position: relative;
}

.reader-page-view {
    transition: all 0.3s ease;
}

.reader-page-edit {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reader-page-textarea {
    resize: vertical;
    min-height: 100px;
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.reader-page-textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.reader-page-text {
    line-height: 1.4;
    color: #495057;
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* Edit button styles */
.reader-page-preview .btn-outline-primary {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-width: 1px;
}

.reader-page-preview .btn-success,
.reader-page-preview .btn-secondary {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Responsive adjustments for reader pages */
@media (max-width: 768px) {
    .reader-page-preview {
        padding: 10px;
    }
    
    .reader-page-textarea {
        min-height: 80px;
    }
    
    .reader-page-preview .d-flex.gap-2 {
        flex-direction: column;
        gap: 8px !important;
    }
    
    .reader-page-preview .btn-outline-primary,
    .reader-page-preview .btn-success,
    .reader-page-preview .btn-secondary {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}