/* Custom Styles for Doc to Markdown Converter */

body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

/* Upload Area Styling */
.upload-area {
    border: 3px dashed #dee2e6;
    border-radius: 15px;
    padding: 3rem 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #ffffff;
}

.upload-area:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.upload-area.dragover {
    border-color: #007bff;
    background-color: #e3f2fd;
    transform: scale(1.02);
}

.upload-content i {
    transition: transform 0.3s ease;
}

.upload-area:hover .upload-content i {
    transform: scale(1.1);
}

/* Card Styling */
.card {
    border: none;
    border-radius: 15px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    font-weight: 600;
}

/* Markdown Preview Styling */
.markdown-preview {
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    resize: both;
    min-height: 300px;
    min-width: 300px;
}

/* Fullscreen modal for preview */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    padding: 20px;
}

.preview-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-modal-content {
    background: white;
    width: 90%;
    height: 90%;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-modal-header {
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.preview-modal-body {
    flex: 1;
    padding: 1rem;
    overflow: hidden;
    display: flex;
    gap: 1rem;
}

.preview-modal-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-modal-panel h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.fullscreen-preview {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
    overflow-y: auto;
    font-family: 'Georgia', serif;
    line-height: 1.7;
}

.fullscreen-textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    background: #f8f8f8;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
    color: #333;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-preview p {
    margin-bottom: 0.8rem;
}

.markdown-preview code {
    background-color: #f1f1f1;
    padding: 2px 4px;
    border-radius: 4px;
}

.markdown-preview pre {
    background-color: #f8f8f8;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    overflow-x: auto;
}

.markdown-preview blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1rem;
    margin-left: 0;
    color: #666;
    font-style: italic;
}

.markdown-preview ul,
.markdown-preview ol {
    padding-left: 2rem;
}

/* Button Styling */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
}

/* Alert Styling */
.alert {
    border: none;
    border-radius: 10px;
    border-left: 4px solid;
}

.alert-danger {
    border-left-color: #dc3545;
    background-color: #f8d7da;
}

.alert-info {
    border-left-color: #17a2b8;
    background-color: #d1ecf1;
}

/* Badge Styling */
.badge {
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Expand buttons */
.expand-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 123, 255, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.expand-btn:hover {
    background: rgba(0, 123, 255, 1);
    transform: scale(1.1);
}

.preview-container {
    position: relative;
}

/* Close button */
.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .upload-area {
        padding: 2rem 1rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .card-body .row .col-md-6 {
        margin-bottom: 2rem;
    }

    .preview-modal-body {
        flex-direction: column;
    }

    .preview-modal-content {
        width: 95%;
        height: 95%;
    }
}

/* Animation for success state */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#resultSection {
    animation: fadeInUp 0.5s ease-out;
}

/* Copy button feedback */
.btn-copied {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.btn-copied i::before {
    content: "\f00c";
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* File input styling */
#fileInput {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Scroll styling for textarea and preview */
.markdown-preview::-webkit-scrollbar,
textarea::-webkit-scrollbar {
    width: 8px;
}

.markdown-preview::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.markdown-preview::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.markdown-preview::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}