/* Custom styles for Prompt Drop */

/* Set Inter as the default font family */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Navbar brand styling for dark theme */
[data-bs-theme="dark"] .navbar-brand {
    color: white !important;
}

/* Ensure consistent text area styling */
#prompt-content {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#prompt-content:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

/* Prompt content display styling */
.prompt-content {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 1rem;
    background-color: var(--bs-gray-100);
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .prompt-content {
    background-color: var(--bs-gray-900);
}

/* Card hover effects */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
} */

/* URL input styling */
.input-group input[readonly] {
    background-color: var(--bs-gray-100);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
}

[data-bs-theme="dark"] .input-group input[readonly] {
    background-color: var(--bs-gray-800);
}

/* Save status animation */
#save-status {
    transition: all 0.3s ease;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    #prompt-content {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .input-group input[readonly] {
        font-size: 11px;
    }
}

/* Smooth transitions for better UX */
* {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

/* Focus styles for accessibility */
.btn:focus,
input:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Loading state for buttons */
.btn.loading {
    pointer-events: none;
    opacity: 0.65;
}

/* Custom scrollbar for webkit browsers */
#prompt-content::-webkit-scrollbar {
    width: 8px;
}

#prompt-content::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
    border-radius: 4px;
}

#prompt-content::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 4px;
}

#prompt-content::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

[data-bs-theme="dark"] #prompt-content::-webkit-scrollbar-track {
    background: var(--bs-gray-800);
}

[data-bs-theme="dark"] #prompt-content::-webkit-scrollbar-thumb {
    background: var(--bs-gray-600);
}

[data-bs-theme="dark"] #prompt-content::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

/* Markdown content styling */
.markdown-content {
    line-height: 1.6;
    color: var(--bs-body-color);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child,
.markdown-content h5:first-child,
.markdown-content h6:first-child {
    margin-top: 0;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.25rem;
}

.markdown-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--bs-primary);
    background-color: var(--bs-gray-100);
    font-style: italic;
}

[data-bs-theme="dark"] .markdown-content blockquote {
    background-color: var(--bs-gray-800);
}

.markdown-content code {
    background-color: var(--bs-gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
}

[data-bs-theme="dark"] .markdown-content code {
    background-color: var(--bs-gray-800);
}

.markdown-content pre {
    background-color: var(--bs-gray-100);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .markdown-content pre {
    background-color: var(--bs-gray-800);
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.markdown-content a {
    color: var(--bs-primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.markdown-content th,
.markdown-content td {
    padding: 0.5rem;
    border: 1px solid var(--bs-border-color);
    text-align: left;
}

.markdown-content th {
    background-color: var(--bs-gray-100);
    font-weight: 600;
}

[data-bs-theme="dark"] .markdown-content th {
    background-color: var(--bs-gray-800);
}

.markdown-content hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--bs-border-color);
}

/* Text content styling */
.text-content {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Prompt viewer container styling */
.prompt-viewer-container {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: calc(100vh - 300px);
    position: relative;
}

.prompt-tabs {
    border: none;
    background-color: transparent;
    margin-bottom: 0;
    padding: 0;
    position: relative;
    z-index: 10;
}

.prompt-tabs .nav-link {
    border: none;
    border-radius: 0;
    margin-top: 0;
    margin-right: 0.25rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    opacity: 0.7;
    transition: all 0.2s ease;
    position: relative;
}

.prompt-tabs .nav-link:first-child {
    margin-left: 0;
}

.prompt-tabs .nav-link:hover {
    background-color: var(--bs-gray-100);
    opacity: 1;
}

[data-bs-theme="dark"] .prompt-tabs .nav-link:hover {
    background-color: var(--bs-gray-800);
}

.prompt-tabs .nav-link.active {
    /* background-color: var(--bs-body-secondary); */
    background-color: #2B3245;
    border: none;
    color: var(--bs-body-color);
    opacity: 1;
    z-index: 11;
}

.copy-button-container {
    padding-right: 0.75rem;
}

.copy-button-container .btn {
    border-radius: 0.375rem;
    color: var(--bs-body-color);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.copy-button-container .btn:hover {
    opacity: 1;
    background-color: var(--bs-gray-200);
}

[data-bs-theme="dark"] .copy-button-container .btn:hover {
    background-color: var(--bs-gray-700);
}

.prompt-content-area {
    flex: 1;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    min-height: 350px;
    overflow-y: auto;
}

.prompt-content-wrapper {
    padding: 1.5rem;
    flex: 1;
}

/* Custom scrollbar for prompt content */
.prompt-content-area::-webkit-scrollbar {
    width: 8px;
}

.prompt-content-area::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
    border-radius: 4px;
}

.prompt-content-area::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 4px;
}

.prompt-content-area::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

[data-bs-theme="dark"] .prompt-content-area::-webkit-scrollbar-track {
    background: var(--bs-gray-800);
}

[data-bs-theme="dark"] .prompt-content-area::-webkit-scrollbar-thumb {
    background: var(--bs-gray-600);
}

[data-bs-theme="dark"] .prompt-content-area::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

/* Remove margins from first and last elements in content */
.prompt-content-wrapper > .markdown-content > *:first-child,
.prompt-content-wrapper > .text-content > *:first-child {
    margin-top: 0 !important;
}

.prompt-content-wrapper > .markdown-content > *:last-child,
.prompt-content-wrapper > .text-content > *:last-child {
    margin-bottom: 0 !important;
}

/* Editor layout for dynamic height */
.editor-container {
    height: calc(100vh - 160px); /* Subtract navbar and footer height */
}

.editor-container .card {
    height: 100%;
}

.editor-container #prompt-content {
    resize: none !important;
    overflow-y: auto;
}

/* Ensure the main content card fills available space properly */
.editor-container .flex-grow-1.card {
    min-height: 0; /* Allow flexbox to shrink below content size */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .prompt-viewer-container {
        min-height: 300px;
        max-height: calc(100vh - 250px);
    }
    
    .prompt-content-wrapper {
        padding: 1rem;
    }
    
    .prompt-tabs {
        padding: 0 0.5rem;
    }
    
    .editor-container {
        height: calc(100vh - 140px);
    }
}
