/* Main CSS for DiffLens */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background-color: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* Smooth transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Navigation animations */
.nav-link:hover {
    transform: translateY(-1px);
}

/* Code highlighting */
.diff-viewer {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
    width: 100%;
}

/* Unified view specific styles */
.diff-viewer:not(.side-by-side-container) {
    overflow-x: auto;
}

.unified-file-container {
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #ffffff;
}

.unified-file-container:last-child {
    margin-bottom: 0;
}

.diff-viewer:not(.side-by-side-container) .diff-line {
    min-width: max-content;
}

.diff-viewer:not(.side-by-side-container) .diff-line-content {
    white-space: pre;
    overflow: visible;
    min-width: max-content;
}

.diff-line {
    display: flex;
    align-items: flex-start;
    border-left: 4px solid transparent;
    min-height: 1.5rem;
    height: 1.5rem;
}

.diff-line-number {
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    user-select: none;
    border-right: 1px solid #e5e7eb;
    min-width: 60px;
    width: 60px;
    text-align: right;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    height: 1.125rem;
    line-height: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.diff-line-content {
    padding: 0.25rem 1rem;
    flex: 1;
    white-space: pre;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    height: 1.125rem;
    line-height: 1.125rem;
    display: flex;
    align-items: center;
    overflow: visible;
}

/* Side-by-side specific adjustments for line content */
.side-by-side-panel .diff-line-content {
    overflow-x: auto;
}

.diff-line-added {
    background-color: #f0fdf4;
    border-left-color: #22c55e;
}

.diff-line-added .diff-line-number {
    background-color: #dcfce7;
    color: #15803d;
}

.diff-line-added .diff-line-content {
    background-color: #f0fdf4;
    color: #166534;
}

.diff-line-removed {
    background-color: #fef2f2;
    border-left-color: #ef4444;
}

.diff-line-removed .diff-line-number {
    background-color: #fecaca;
    color: #dc2626;
}

.diff-line-removed .diff-line-content {
    background-color: #fef2f2;
    color: #dc2626;
}

.diff-line-unchanged {
    background-color: #ffffff;
    border-left-color: #d1d5db;
}

.diff-line-context {
    background-color: #f9fafb;
    border-left-color: #9ca3af;
}

.diff-line-context .diff-line-number {
    background-color: #e5e7eb;
    color: #4b5563;
}

.diff-line-context .diff-line-content {
    background-color: #f9fafb;
    color: #374151;
}

.diff-line-empty {
    background-color: #ffffff;
    border-left-color: #e5e7eb;
    min-height: 1.5rem;
    height: 1.5rem;
}

.diff-line-empty .diff-line-number {
    background-color: #f3f4f6;
    color: #d1d5db;
    min-height: 1.125rem;
    height: 1.125rem;
}

.diff-line-empty .diff-line-content {
    background-color: #ffffff;
    min-height: 1.125rem;
    height: 1.125rem;
    line-height: 1.125rem;
}

/* File header styling */
.diff-file-header {
    background-color: #1f2937;
    color: #ffffff;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid #374151;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
}

.diff-hunk-header {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 4px solid #3b82f6;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
}

/* Side-by-side view specific styles */
.side-by-side-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background-color: #d1d5db;
    width: 100%;
}

.side-by-side-panel {
    background-color: #ffffff;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.side-by-side-content {
    width: 100%;
    min-width: max-content;
    flex: 1;
}

/* Side-by-side specific diff line adjustments */
.side-by-side-panel .diff-line {
    min-width: max-content;
    width: 100%;
}

.side-by-side-panel .diff-line-content {
    min-width: 200px;
    flex: 1;
    white-space: pre;
}

.side-by-side-header {
    background-color: #f3f4f6;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Responsive design for side-by-side */
@media (max-width: 768px) {
    .side-by-side-container {
        grid-template-columns: 1fr;
    }
    
    .side-by-side-panel:first-child {
        border-bottom: 2px solid #e5e7eb;
    }
}

/* Loading animation */
.loading-spinner {
    display: inline-block;
    height: 1rem;
    width: 1rem;
    animation: spin 1s linear infinite;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* File upload styling */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #2563eb;
    background-color: rgba(37, 99, 235, 0.05);
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Code syntax highlighting */
.syntax-keyword {
    color: #7c3aed;
    font-weight: 600;
}

.syntax-string {
    color: #059669;
}

.syntax-comment {
    color: #6b7280;
    font-style: italic;
}

.syntax-number {
    color: #2563eb;
}

.syntax-operator {
    color: #374151;
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Utility classes */
.text-balance {
    text-wrap: balance;
}

/* Focus styles */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

/* Custom button styles */
.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.5);
}

.btn-outline {
    border: 1px solid #2563eb;
    color: #2563eb;
    background-color: transparent;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-outline:hover {
    background-color: #2563eb;
    color: #ffffff;
}

.btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

/* Responsive typography */
@media (max-width: 640px) {
    .diff-viewer {
        font-size: 12px;
    }
    
    .diff-line-number {
        min-width: 40px;
        padding: 0.25rem 0.5rem;
    }
    
    .diff-line-content {
        padding: 0.25rem 0.5rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .diff-viewer {
        font-size: 10px;
        line-height: 1.3;
    }
}

/* Tutorial Section Styles */
#tutorial-content {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}

#tutorial-content:not(.hidden) {
    opacity: 1;
}

#tutorial-toggle {
    transition: background-color 0.2s ease;
}

#tutorial-toggle:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

#tutorial-chevron {
    transition: transform 0.2s ease;
}

.tutorial-command-block {
    background-color: #1a1a1a;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    overflow-x: auto;
}

.tutorial-command-block code {
    color: #4ade80;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 0.875rem;
    font-weight: 500;
}

.tutorial-card {
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.tutorial-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}

.tutorial-section-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Tutorial responsive adjustments */
@media (max-width: 640px) {
    #tutorial-content .grid {
        grid-template-columns: 1fr;
    }
    
    .tutorial-command-block code {
        font-size: 0.75rem;
    }
}

/* Connection status and dark mode support could be added here */

/* Share Modal Styles */
#share-modal {
    backdrop-filter: blur(4px);
}

#share-modal .bg-white {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#share-url {
    font-size: 13px;
    word-break: break-all;
}

#copy-share-url {
    transition: all 0.2s ease;
    min-width: 60px;
}

#copy-share-url:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

#copy-success {
    animation: fadeInOut 3s ease-in-out;
}

/* Validation error styling */
#share-validation-error {
    border-left: 4px solid #ef4444;
}

#share-validation-error::before {
    content: '⚠️ ';
    margin-right: 0.5rem;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translateY(5px); }
    20%, 80% { opacity: 1; transform: translateY(0); }
}

/* Share button styling */
#share-diff {
    transition: all 0.2s ease;
}

#share-diff:hover {
    transform: translateY(-1px);
}
