/* AI Code Review IDE - Frontend Styles */

.ai-code-review-ide-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    margin: 30px auto;
    padding: 0;
    width: 100%;
    max-width: 1400px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    clear: both;
    box-sizing: border-box;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Dark Theme (Default) */
.ai-code-review-ide-container.ai-ide-theme-dark {
    background: linear-gradient(135deg, #1a1a1a 0%, #1e1e1e 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 
                0 2px 8px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Light Theme */
.ai-code-review-ide-container.ai-ide-theme-light {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 
                0 2px 8px rgba(0, 0, 0, 0.04),
                0 0 0 1px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.ai-ide-header {
    background: linear-gradient(135deg, #2d2d30 0%, #252526 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
}

.ai-ide-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.ai-ide-title {
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    letter-spacing: -0.4px;
    transition: color 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-ide-theme-dark .ai-ide-title {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ai-ide-theme-light .ai-ide-title {
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.ai-ide-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4),
                0 2px 4px rgba(74, 158, 255, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-ide-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.5),
                0 3px 6px rgba(74, 158, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.ai-ide-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.ai-ide-theme-selector,
.ai-ide-language-selector {
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    min-width: 140px;
    height: 40px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ai-ide-theme-selector {
    min-width: 110px;
}

/* Dark theme selectors */
.ai-ide-theme-dark .ai-ide-theme-selector,
.ai-ide-theme-dark .ai-ide-language-selector {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e8e8e8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-ide-theme-dark .ai-ide-theme-selector:hover,
.ai-ide-theme-dark .ai-ide-language-selector:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

/* Light theme selectors */
.ai-ide-theme-light .ai-ide-theme-selector,
.ai-ide-theme-light .ai-ide-language-selector {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ai-ide-theme-light .ai-ide-theme-selector:hover,
.ai-ide-theme-light .ai-ide-language-selector:hover {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.ai-ide-theme-selector:focus,
.ai-ide-language-selector:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.ai-ide-btn {
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.01em;
}

.ai-ide-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.ai-ide-btn:hover::before {
    width: 300px;
    height: 300px;
}

.ai-ide-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.ai-ide-btn-primary {
    background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.35),
                0 2px 4px rgba(74, 158, 255, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-ide-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5aaeff 0%, #458acd 100%);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.45),
                0 3px 6px rgba(74, 158, 255, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.ai-ide-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3),
                inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-ide-btn-secondary {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-ide-theme-dark .ai-ide-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-ide-theme-dark .ai-ide-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.ai-ide-theme-light .ai-ide-btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ai-ide-theme-light .ai-ide-btn-secondary:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.ai-ide-btn-secondary:active:not(:disabled) {
    transform: translateY(0);
}

.ai-ide-main-content {
    display: flex;
    overflow: hidden;
    min-height: 600px;
    width: 100%;
    transition: background 0.3s ease;
    align-items: stretch;
}

.ai-ide-theme-dark .ai-ide-main-content {
    background: #1e1e1e;
}

.ai-ide-theme-light .ai-ide-main-content {
    background: #ffffff;
}

.ai-ide-editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3c3c3c;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
    height: 100%;
    min-height: 600px;
}

.ai-ide-theme-dark .ai-ide-editor-panel {
    background: #1e1e1e;
    border-right-color: #3c3c3c;
}

.ai-ide-theme-light .ai-ide-editor-panel {
    background: #ffffff;
    border-right-color: #ddd;
}

.ai-ide-editor-toolbar {
    padding: 12px 20px;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.ai-ide-theme-dark .ai-ide-editor-toolbar {
    background: #252526;
    border-bottom-color: #3c3c3c;
    color: #cccccc;
}

.ai-ide-theme-light .ai-ide-editor-toolbar {
    background: #f8f9fa;
    border-bottom-color: #ddd;
    color: #333;
}

.ai-ide-file-name {
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    transition: color 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-file-name {
    color: #d4d4d4;
}

.ai-ide-theme-light .ai-ide-file-name {
    color: #333;
}

.ai-ide-file-name::before {
    content: '';
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234a9eff'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    opacity: 0.8;
}

.ai-ide-line-count {
    font-size: 12px;
    color: #858585;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.ai-ide-code-editor {
    display: none;
}

.CodeMirror {
    flex: 1;
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    line-height: 1.6;
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 0;
}

.ai-ide-theme-dark .CodeMirror {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
}

.ai-ide-theme-light .CodeMirror {
    background: #ffffff !important;
    color: #333 !important;
}

.CodeMirror-scroll {
    cursor: text !important;
    pointer-events: auto !important;
    transition: background 0.3s ease;
}

.ai-ide-theme-dark .CodeMirror-scroll {
    background: #1e1e1e;
}

.ai-ide-theme-light .CodeMirror-scroll {
    background: #ffffff;
}

.CodeMirror-cursor {
    pointer-events: none !important;
}

.CodeMirror-readonly .CodeMirror-cursor {
    display: none !important;
}

.CodeMirror-readonly {
    pointer-events: none !important;
}

.CodeMirror-gutters {
    border-right: 1px solid #3c3c3c;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    backdrop-filter: blur(5px);
}

.ai-ide-theme-dark .CodeMirror-gutters {
    background: linear-gradient(180deg, #252526 0%, #1e1e1e 100%) !important;
    border-right-color: rgba(255, 255, 255, 0.08);
    color: #858585;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.ai-ide-theme-light .CodeMirror-gutters {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%) !important;
    border-right-color: rgba(0, 0, 0, 0.08);
    color: #666;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.02);
}

.CodeMirror-linenumber {
    color: #858585 !important;
    padding: 0 10px 0 6px;
    min-width: 24px;
    text-align: right;
    font-weight: 500;
    transition: color 0.2s ease;
}

.CodeMirror-linenumber:hover {
    color: #cccccc !important;
}

.ai-ide-theme-light .CodeMirror-linenumber {
    color: #999 !important;
}

.ai-ide-theme-light .CodeMirror-linenumber:hover {
    color: #666 !important;
}

.CodeMirror-cursor {
    border-left: 2px solid #aeafad;
    border-left-width: 2px;
    margin-left: -1px;
}

.CodeMirror-cursor.CodeMirror-overwrite {
    border-left: 0;
    border-bottom: 1px solid #aeafad;
}

.CodeMirror-selected {
    background: #264f78 !important;
}

.CodeMirror-focused .CodeMirror-selected {
    background: #214283 !important;
}

.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection {
    background: #214283;
}

.CodeMirror-activeline-background {
    background: rgba(255, 255, 255, 0.03) !important;
}

.CodeMirror-matchingbracket {
    background: rgba(0, 122, 204, 0.3) !important;
    color: #fff !important;
    border: 1px solid rgba(0, 122, 204, 0.5);
    border-radius: 2px;
}

.CodeMirror-nonmatchingbracket {
    background: rgba(255, 0, 0, 0.2) !important;
    color: #f48771 !important;
}

.CodeMirror-foldgutter-open:after {
    content: '\25BE';
    color: #858585;
    font-size: 12px;
}

.CodeMirror-foldgutter-folded:after {
    content: '\25B8';
    color: #858585;
    font-size: 12px;
}

.CodeMirror-foldgutter {
    width: 15px;
}

/* Syntax highlighting colors - IDE-like */
.CodeMirror .cm-keyword {
    color: #c586c0 !important;
    font-weight: 500;
}

.CodeMirror .cm-def {
    color: #4ec9b0 !important;
}

.CodeMirror .cm-variable {
    color: #9cdcfe !important;
}

.CodeMirror .cm-variable-2 {
    color: #4fc1ff !important;
}

.CodeMirror .cm-variable-3 {
    color: #4ec9b0 !important;
}

.CodeMirror .cm-string {
    color: #ce9178 !important;
}

.CodeMirror .cm-string-2 {
    color: #6a9955 !important;
}

.CodeMirror .cm-number {
    color: #b5cea8 !important;
}

.CodeMirror .cm-atom {
    color: #569cd6 !important;
}

.CodeMirror .cm-operator {
    color: #d4d4d4 !important;
}

.CodeMirror .cm-comment {
    color: #6a9955 !important;
    font-style: italic;
}

.CodeMirror .cm-meta {
    color: #569cd6 !important;
}

.CodeMirror .cm-tag {
    color: #569cd6 !important;
}

.CodeMirror .cm-attribute {
    color: #92c5f7 !important;
}

.CodeMirror .cm-property {
    color: #9cdcfe !important;
}

.CodeMirror .cm-qualifier {
    color: #d7ba7d !important;
}

.CodeMirror .cm-builtin {
    color: #4ec9b0 !important;
}

.CodeMirror .cm-type {
    color: #4ec9b0 !important;
}

.CodeMirror .cm-function {
    color: #dcdcaa !important;
}

.CodeMirror .cm-header {
    color: #569cd6 !important;
}

.CodeMirror .cm-link {
    color: #569cd6 !important;
    text-decoration: underline;
}

.CodeMirror .cm-error {
    color: #f48771 !important;
    background: rgba(244, 135, 113, 0.1);
}

/* Scrollbar styling */
.CodeMirror-scrollbar-filler {
    background: #1e1e1e;
}

.CodeMirror .CodeMirror-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.CodeMirror .CodeMirror-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.CodeMirror .CodeMirror-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.CodeMirror .CodeMirror-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.CodeMirror .CodeMirror-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Selection highlight */
.CodeMirror-selectedtext {
    background: #214283 !important;
}

/* Active line highlight */
.CodeMirror-activeline .CodeMirror-linenumber {
    color: #cccccc !important;
    font-weight: 600;
}

/* Search matches */
.CodeMirror-searching {
    background: rgba(255, 255, 0, 0.3) !important;
}

.CodeMirror-searching.CodeMirror-searching {
    border-bottom: 1px solid #ffd700;
}

/* Overlay scrollbars */
.CodeMirror-overlay {
    background: rgba(0, 0, 0, 0.1);
}

/* Ensure syntax highlighting takes precedence over theme */
.CodeMirror .cm-keyword,
.CodeMirror .cm-def,
.CodeMirror .cm-variable,
.CodeMirror .cm-variable-2,
.CodeMirror .cm-variable-3,
.CodeMirror .cm-string,
.CodeMirror .cm-string-2,
.CodeMirror .cm-number,
.CodeMirror .cm-atom,
.CodeMirror .cm-operator,
.CodeMirror .cm-comment,
.CodeMirror .cm-meta,
.CodeMirror .cm-tag,
.CodeMirror .cm-attribute,
.CodeMirror .cm-property,
.CodeMirror .cm-qualifier,
.CodeMirror .cm-builtin,
.CodeMirror .cm-type,
.CodeMirror .cm-function,
.CodeMirror .cm-header,
.CodeMirror .cm-link,
.CodeMirror .cm-error {
    font-weight: inherit !important;
}

/* Additional IDE features */
.CodeMirror .CodeMirror-lines {
    padding: 12px 0;
}

.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {
    padding: 0 12px;
}

/* Indent guides */
.CodeMirror .CodeMirror-line {
    position: relative;
}

/* Better focus state */
.CodeMirror-focused {
    outline: none;
}

.CodeMirror-focused .CodeMirror-activeline-background {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Whitespace visualization (optional - can be enabled) */
.CodeMirror .cm-tab {
    border-left: 1px dotted rgba(255, 255, 255, 0.1);
    margin-left: -1px;
}

/* Better bracket matching */
.CodeMirror-matchingtag {
    background: rgba(0, 122, 204, 0.2) !important;
    border-bottom: 1px solid rgba(0, 122, 204, 0.5);
}

.ai-ide-review-panel {
    width: 45%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background 0.3s ease;
    height: 100%;
    min-height: 600px;
    align-self: stretch;
}

.ai-ide-theme-dark .ai-ide-review-panel {
    background: linear-gradient(135deg, #252526 0%, #2a2a2a 100%);
}

.ai-ide-theme-light .ai-ide-review-panel {
    background: #f8f9fa;
}

.ai-ide-review-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

.ai-ide-theme-dark .ai-ide-review-header {
    background: linear-gradient(135deg, #2d2d30 0%, #252526 100%);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.ai-ide-theme-light .ai-ide-review-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    border-bottom-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}

.ai-ide-review-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    transition: background 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-review-header::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.ai-ide-theme-light .ai-ide-review-header::after {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.ai-ide-review-header h2 {
    font-size: 15px;
    margin: 0 0 6px 0;
    font-weight: 600;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-review-header h2 {
    color: #ffffff;
}

.ai-ide-theme-light .ai-ide-review-header h2 {
    color: #333;
}

.ai-ide-review-header h2::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
    border-radius: 2px;
}

.ai-ide-review-status {
    font-size: 12px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-review-status {
    color: #a0a0a0;
}

.ai-ide-theme-light .ai-ide-review-status {
    color: #666;
}

.ai-ide-review-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    transition: background 0.3s ease, scrollbar-color 0.3s ease;
    min-height: 0;
}

.ai-ide-theme-dark .ai-ide-review-content {
    background: #1e1e1e;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.ai-ide-theme-light .ai-ide-review-content {
    background: #ffffff;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.ai-ide-review-content::-webkit-scrollbar {
    width: 8px;
}

.ai-ide-review-content::-webkit-scrollbar-track {
    background: transparent;
}

.ai-ide-theme-dark .ai-ide-review-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.ai-ide-theme-dark .ai-ide-review-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-ide-theme-light .ai-ide-review-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.ai-ide-theme-light .ai-ide-review-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.ai-ide-review-placeholder {
    text-align: center;
    padding: 60px 20px;
    transition: color 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-review-placeholder {
    color: #6a6a6a;
}

.ai-ide-theme-light .ai-ide-review-placeholder {
    color: #999;
}

.ai-ide-review-placeholder svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    opacity: 0.4;
    stroke: #4a9eff;
    filter: drop-shadow(0 2px 4px rgba(74, 158, 255, 0.2));
}

.ai-ide-review-placeholder h3 {
    color: #b0b0b0;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.ai-ide-review-placeholder p {
    color: #858585;
    font-size: 13px;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

.ai-ide-review-result {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.ai-ide-review-section {
    margin-bottom: 20px;
    padding: 22px;
    border-radius: 12px;
    border-left: 4px solid #4a9eff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-review-section {
    background: linear-gradient(135deg, rgba(45, 45, 48, 0.7) 0%, rgba(37, 37, 38, 0.7) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
                0 1px 3px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-ide-theme-light .ai-ide-review-section {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.ai-ide-review-section:hover {
    transform: translateY(-2px);
}

.ai-ide-theme-dark .ai-ide-review-section:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
                0 2px 6px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ai-ide-theme-light .ai-ide-review-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12),
                0 2px 6px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 1);
}

.ai-ide-review-section h3 {
    font-size: 14px;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.2px;
    transition: color 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-review-section h3 {
    color: #ffffff;
}

.ai-ide-theme-light .ai-ide-review-section h3 {
    color: #333;
}

.ai-ide-review-section h3 svg,
.ai-ide-review-section h3 .ai-ide-icon-inline {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ai-ide-review-section p {
    line-height: 1.7;
    margin-bottom: 10px;
    font-size: 13px;
    transition: color 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-review-section p {
    color: #d0d0d0;
}

.ai-ide-theme-light .ai-ide-review-section p {
    color: #555;
}

.ai-ide-review-section ul,
.ai-ide-review-section ol {
    margin-left: 24px;
    line-height: 1.8;
    font-size: 13px;
    transition: color 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-review-section ul,
.ai-ide-theme-dark .ai-ide-review-section ol {
    color: #d0d0d0;
}

.ai-ide-theme-light .ai-ide-review-section ul,
.ai-ide-theme-light .ai-ide-review-section ol {
    color: #555;
}

.ai-ide-review-section li {
    margin-bottom: 6px;
}

.ai-ide-severity-high {
    border-left-color: #ff6b6b;
}

.ai-ide-theme-dark .ai-ide-severity-high {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.12) 0%, rgba(37, 37, 38, 0.7) 100%);
}

.ai-ide-theme-light .ai-ide-severity-high {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.08) 0%, #ffffff 100%);
    border-color: rgba(255, 107, 107, 0.2);
}

.ai-ide-severity-medium {
    border-left-color: #ffd93d;
}

.ai-ide-theme-dark .ai-ide-severity-medium {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.12) 0%, rgba(37, 37, 38, 0.7) 100%);
}

.ai-ide-theme-light .ai-ide-severity-medium {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.08) 0%, #ffffff 100%);
    border-color: rgba(255, 217, 61, 0.2);
}

.ai-ide-severity-low {
    border-left-color: #6bcf7f;
}

.ai-ide-theme-dark .ai-ide-severity-low {
    background: linear-gradient(135deg, rgba(107, 207, 127, 0.12) 0%, rgba(37, 37, 38, 0.7) 100%);
}

.ai-ide-theme-light .ai-ide-severity-low {
    background: linear-gradient(135deg, rgba(107, 207, 127, 0.08) 0%, #ffffff 100%);
    border-color: rgba(107, 207, 127, 0.2);
}

.ai-ide-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.ai-ide-badge-error {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    box-shadow: 0 1px 3px rgba(255, 107, 107, 0.2);
}

.ai-ide-badge-warning {
    background: rgba(255, 217, 61, 0.15);
    color: #ffd93d;
    border: 1px solid rgba(255, 217, 61, 0.3);
    box-shadow: 0 1px 3px rgba(255, 217, 61, 0.2);
}

.ai-ide-badge-success {
    background: rgba(107, 207, 127, 0.15);
    color: #6bcf7f;
    border: 1px solid rgba(107, 207, 127, 0.3);
    box-shadow: 0 1px 3px rgba(107, 207, 127, 0.2);
}

.ai-ide-badge-info {
    background: rgba(74, 158, 255, 0.15);
    color: #4a9eff;
    border: 1px solid rgba(74, 158, 255, 0.3);
    box-shadow: 0 1px 3px rgba(74, 158, 255, 0.2);
}

.ai-ide-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #4a9eff;
    flex-direction: column;
    gap: 16px;
}

.ai-ide-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(74, 158, 255, 0.15);
    border-top-color: #4a9eff;
    border-right-color: rgba(74, 158, 255, 0.5);
    border-radius: 50%;
    animation: spin 0.75s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.2);
}

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

.ai-ide-code-snippet {
    padding: 12px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    margin: 12px 0;
    overflow-x: auto;
    transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}

.ai-ide-theme-dark .ai-ide-code-snippet {
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid #4a9eff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ai-ide-theme-light .ai-ide-code-snippet {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-left: 3px solid #4a9eff;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai-ide-stats-bar {
    padding: 14px 20px;
    background: linear-gradient(135deg, #2d2d30 0%, #252526 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.ai-ide-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #d0d0d0;
    font-weight: 500;
}

.ai-ide-stat-value {
    font-weight: 700;
    color: #4a9eff;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ai-ide-review-panel {
        width: 40%;
    }
}

@media (max-width: 1024px) {
    .ai-ide-main-content {
        flex-direction: column;
    }

    .ai-ide-editor-panel,
    .ai-ide-review-panel {
        width: 100%;
        border-right: none;
    }

    .ai-ide-editor-panel {
        min-height: 400px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .ai-ide-review-panel {
        min-height: 300px;
    }
}

@media (max-width: 1440px) {
    .ai-code-review-ide-container {
        max-width: calc(100% - 40px);
        margin: 20px auto;
    }
}

@media (max-width: 768px) {
    .ai-code-review-ide-container {
        max-width: calc(100% - 20px);
        margin: 15px auto;
        border-radius: 6px;
    }

    .ai-ide-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 18px;
        gap: 12px;
    }

    .ai-ide-title {
        font-size: 16px;
        width: 100%;
    }

    .ai-ide-header-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .ai-ide-language-selector {
        width: 100%;
        min-width: auto;
    }

    .ai-ide-btn {
        flex: 1;
        min-width: auto;
        width: 100%;
        font-size: 12px;
        padding: 10px 14px;
    }

    .ai-ide-main-content {
        min-height: 500px;
    }

    .ai-ide-editor-panel {
        min-height: 350px;
    }

    .ai-ide-review-panel {
        min-height: 250px;
    }

    .ai-ide-editor-toolbar {
        padding: 8px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ai-ide-file-name {
        font-size: 12px;
    }

    .ai-ide-line-count {
        font-size: 11px;
    }

    .CodeMirror {
        font-size: 13px;
    }

    .ai-ide-review-header {
        padding: 12px 16px;
    }

    .ai-ide-review-header h2 {
        font-size: 14px;
    }

    .ai-ide-review-status {
        font-size: 11px;
    }

    .ai-ide-review-content {
        padding: 16px;
    }

    .ai-ide-review-section {
        padding: 12px;
        margin-bottom: 12px;
    }

    .ai-ide-review-section h3 {
        font-size: 13px;
    }

    .ai-ide-review-section p {
        font-size: 12px;
    }

    .ai-ide-stats-bar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 16px;
    }

    .ai-ide-stat {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ai-ide-header {
        padding: 12px 16px;
    }

    .ai-ide-title {
        font-size: 15px;
    }

    .ai-ide-icon {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .ai-ide-btn {
        font-size: 11px;
        padding: 8px 12px;
        height: 36px;
    }

    .ai-ide-main-content {
        min-height: 450px;
    }

    .ai-ide-editor-panel {
        min-height: 300px;
    }

    .ai-ide-review-panel {
        min-height: 200px;
    }

    .ai-ide-editor-toolbar {
        padding: 6px 12px;
    }

    .ai-ide-review-content {
        padding: 12px;
    }

    .ai-ide-review-placeholder {
        padding: 40px 16px;
    }

    .ai-ide-review-placeholder svg {
        width: 48px;
        height: 48px;
    }

    .ai-ide-review-placeholder h3 {
        font-size: 16px;
    }

    .ai-ide-review-placeholder p {
        font-size: 12px;
    }

    .ai-ide-notification {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        font-size: 12px;
        padding: 12px 16px;
    }
}

/* Notification */
.ai-ide-notification {
    position: fixed;
    top: 60px;
    right: 24px;
    border-radius: 10px;
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                0 4px 8px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-ide-theme-dark .ai-ide-notification {
    background: linear-gradient(135deg, #2d2d30 0%, #252526 100%);
    border: 1px solid rgba(107, 207, 127, 0.3);
    color: #6bcf7f;
}

.ai-ide-theme-light .ai-ide-notification {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(107, 207, 127, 0.4);
    color: #4a9e4a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
                0 4px 8px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ai-ide-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-ide-theme-dark .ai-ide-notification.error {
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.ai-ide-theme-light .ai-ide-notification.error {
    border-color: rgba(255, 107, 107, 0.4);
    color: #d32f2f;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.ai-ide-notification.hiding {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Icon replacements */
.ai-ide-icon-inline {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

/* Template items */
.ai-ide-template-item {
    transition: all 0.2s ease;
}

.ai-ide-template-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.ai-ide-template-item h3 {
    color: #4a9eff;
    margin-bottom: 12px;
}

/* Language selector optgroups */
.ai-ide-language-selector optgroup {
    font-weight: 600;
    color: #4a9eff;
}

.ai-ide-language-selector option {
    font-weight: 400;
    color: #e0e0e0;
}
