/* Modern sleek design with contemporary styling */
html {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
}
@supports (font-variation-settings: normal) {
    html { font-family: 'Inter var', system-ui, -apple-system, sans-serif; }
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: rgba(255, 255, 255, 0.9);
    min-height: 100vh;
    position: relative;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    margin: 0;
    padding: 0;
}

/* Glass morphism ambient effects */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Glass texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

/* Glass scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: all 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Form container bold text */
#form-container {
    font-weight: bold;
}

/* Independent scrolling for both editors */
.editors-grid {
    overflow: scroll;
    height: calc(100vh - 320px); /* Adjust for top bar + title section height */
    min-height: 0;
    padding-bottom: 10px !important;
}

.editors-grid > div:first-child {
    height: 100%;
    padding: 0 !important;
}

.title-section {
    padding: 0 !important;
}

/* Ensure buttons in YAML editor header are clickable */
#share-yaml-btn,
#copy-yaml-btn,
#like-yaml-btn {
    pointer-events: auto;
    z-index: 10;
    position: relative;
}

/* Share Modal Styles */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-modal-overlay.show {
    opacity: 1;
}

.share-modal {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.share-modal-overlay.show .share-modal {
    transform: scale(1);
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.share-modal-content {
    padding: 20px 24px;
}

.share-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    max-width: 400px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    opacity: 0;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    background: rgba(34, 197, 94, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.notification-error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.notification-warning {
    background: rgba(245, 158, 11, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.notification-info {
    background: rgba(59, 130, 246, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.editor-container {
    overflow: hidden;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.editor-container .flex-grow {
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#form-container {
    overflow-y: scroll;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

#yaml-editor-container {
    overflow: auto;
    flex: 1;
    min-height: 0;
}

/* Ensure CodeMirror respects the container height */
.CodeMirror {
    height: 100% !important;
    max-height: 100% !important;
}

/* YAML Highlighting Overlay */
.yaml-highlight-overlay {
    position: absolute;
    background: rgba(59, 130, 246, 0.2);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.yaml-highlight-overlay.active {
    opacity: 1;
}

/* Glass morphism surface */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.95);
    padding: 24px;
}

.glass::before {
    display: none;
}

.glass-dark {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    color: rgba(255, 255, 255, 0.95);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px;
}

.glass-dark::before {
    display: none;
}

/* Glass morphism card */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateZ(0) scale(1);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    color: rgba(255, 255, 255, 0.95);
    overflow: hidden;
}

.card::before {
    display: none;
}

.card:hover {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-4px) scale(1.005);
}

/* Lightweight editor hover effects */
.editor-container {
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

/* Simple hover effects without transforms */
.editors-grid:hover .editor-container:not(:hover) {
    opacity: 0.8;
}

.editors-grid:hover .editor-container:hover {
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Remove left and right padding from editors grid and reduce gap */
.editors-grid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    gap: 0.75rem !important; /* Reduce gap from 2rem (gap-8) to 0.75rem */
}

/* Material Design button interactions */
.btn-primary, .btn-secondary {
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn-primary:focus, .btn-secondary:focus {
    outline: none;
}

.btn-primary:active, .btn-secondary:active {
    transform: scale(0.98);
}

/* Glass morphism input focus states */
.form-input, .form-select {
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus, .form-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.5);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 3px rgba(99, 102, 241, 0.2);
    color: rgba(255, 255, 255, 1);
}

/* Modern subtle glow effects */
.glow {
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
}

.glow:hover {
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Glass morphism button */
.btn-primary {
    background: rgba(99, 102, 241, 0.8);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 1);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0.025em;
    padding: 16px 32px;
    min-width: 64px;
    min-height: 48px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    outline: none;
    margin: 8px;
}

.btn-primary:hover {
    background: rgba(99, 102, 241, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0.025em;
    padding: 16px 32px;
    min-width: 64px;
    min-height: 48px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    outline: none;
    margin: 8px;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    color: rgba(255, 255, 255, 1);
}

/* Glass morphism input */
.form-input {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    padding: 16px;
    outline: none;
    margin: 8px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Annotation styles */
.annotation-container {
    position: relative;
}

.annotation-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.annotation-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.6);
}

.annotation-btn.has-annotation {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
}

.annotation-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 300px;
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.95) 0%, 
        rgba(15, 23, 42, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 20;
    display: none;
}

.annotation-popup.show {
    display: block;
    animation: slideInUp 0.2s ease-out;
}

/* Line clamp utility for responsive text */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Explore modal styles */
.explore-modal {
    /* Ensure modal is above everything */
    z-index: 9999;
}

/* Ensure modal content is interactive */
.explore-modal .relative {
    pointer-events: auto;
    z-index: 10000;
}

/* Prevent text selection on backdrop */
#explore-backdrop {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
}