/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    background: #2b2b2b;
    color: #ffffff;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Menu Bar */
#menuBar {
    background: #1e1e1e;
    padding: 4px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #404040;
    gap: 16px;
    height: 40px;
}

.menu-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-group:last-child {
    flex: 1;
    justify-content: flex-end;
}

.menu-group label {
    font-size: 12px;
    color: #cccccc;
    white-space: nowrap;
}

.menu-group input {
    background: #404040;
    border: 1px solid #606060;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    width: 60px;
    height: 24px;
}

.menu-group input[type="color"] {
    width: 40px;
    height: 28px;
    padding: 2px;
}

.menu-group button {
    background: #404040;
    border: 1px solid #606060;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    height: 24px;
}

.menu-group button:hover {
    background: #505050;
}

/* Frame and Time Display */
.frame-label,
.time-label,
.zoom-label {
    font-size: 12px;
    color: #cccccc;
    white-space: nowrap;
    margin-right: 4px;
}

#currentFrameDisplay,
#totalFramesDisplay,
#currentTimeDisplay,
#currentZoomDisplay {
    font-size: 12px;
    color: #aaaaaa;
    background: #353535;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
    font-family: monospace;
}

/* Main Content */
#mainContent {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Left Toolbar */
#leftToolbar {
    width: 80px;
    background: #1e1e1e;
    border-right: 1px solid #404040;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-btn {
    width: 64px;
    height: 48px;
    background: #404040;
    border: 1px solid #606060;
    color: #ffffff;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: #505050;
    transform: translateY(-1px);
}

.tool-btn.active {
    background: #0078d4;
    border-color: #106ebe;
    box-shadow: 0 2px 4px rgba(0, 120, 212, 0.3);
}

.tool-btn:disabled {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #666666;
    cursor: not-allowed;
    transform: none;
}

/* Material Icons */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.tool-btn.exporting {
    background: #ff6b1a;
    border-color: #e55a0e;
    animation: pulse 1.5s infinite;
}

.tool-btn.exporting:hover {
    background: #ff6b1a;
    transform: none;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.upload-btn {
    width: 64px;
    height: 48px;
    background: #404040;
    border: 1px solid #606060;
    color: #ffffff;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    text-align: center;
    padding: 4px;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background: #505050;
    transform: translateY(-1px);
}

#fontList {
    margin-top: 8px;
    font-size: 10px;
    color: #cccccc;
    max-height: 200px;
    overflow-y: auto;
}

.font-item {
    padding: 4px 6px;
    margin: 2px 0;
    background: #2b2b2b;
    border-radius: 3px;
    word-break: break-all;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.font-item:hover {
    background: #3b3b3b;
}

.font-delete {
    background: #d32f2f;
    border: none;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.font-item:hover .font-delete {
    opacity: 1;
}

.font-delete:hover {
    background: #b71c1c;
}

/* Canvas Container - Main flex container */
#canvasContainer {
    flex: 1;
    position: relative;
    background: #3c3c3c;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

/* Canvas Scroll Area - Handles scrolling */
#canvasScrollArea {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: relative;
}

/* Canvas Wrapper - Contains the canvas with absolute positioning */
#canvasWrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom scrollbars */
#canvasScrollArea::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#canvasScrollArea::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 6px;
}

#canvasScrollArea::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 6px;
    border: 2px solid #2a2a2a;
}

#canvasScrollArea::-webkit-scrollbar-thumb:hover {
    background: #666;
}

#canvasScrollArea::-webkit-scrollbar-corner {
    background: #2a2a2a;
}

/* Firefox scrollbar styling */
#canvasScrollArea {
    scrollbar-width: thin;
    scrollbar-color: #555 #2a2a2a;
    /* Removed scroll-behavior: smooth to prevent lag during hand tool panning */
}

#mainCanvas {
    display: block;
    background: #ffffff;
    border-radius: 4px;
    cursor: grab;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform-origin: center center;

    /* Ensure high-quality rendering on high-DPI displays */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-quality;

    /* Enable hardware acceleration for better performance */
    will-change: transform;
}

#mainCanvas.grabbing {
    cursor: grabbing;
    /* Disable transitions during panning for smooth performance */
    transition: none !important;
}

/* Disable smooth scrolling during panning for better performance */
#canvasScrollArea.panning {
    scroll-behavior: auto !important;
}

#mainCanvas.hand-cursor {
    cursor: grab;
}

#mainCanvas.text-cursor {
    cursor: text;
}

#mainCanvas.select-cursor {
    cursor: default;
}

#mainCanvas.arrow-cursor {
    cursor: default;
}

#canvasOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    transform-origin: center center;
}

.selection-box {
    position: absolute;
    border: 2px solid #0078d4;
    background: rgba(0, 120, 212, 0.1);
    border-radius: 4px;
    pointer-events: none;
}

.selection-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0078d4;
    border: 1px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
}

.text-editor {
    font-family: inherit;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #0078d4;
    border-radius: 4px;
    padding: 4px 8px;
    resize: none;
    outline: none;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Right Panel */
#rightPanel {
    width: 320px;
    background: #1e1e1e;
    border-left: 1px solid #404040;
    padding: 16px;
    overflow-y: auto;
}

#rightPanel h3 {
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 16px;
    border-bottom: 1px solid #404040;
    padding-bottom: 8px;
}

.property-group {
    margin-bottom: 16px;
}

.property-group label {
    display: block;
    color: #cccccc;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 500;
}

.property-group input,
.property-group select,
.property-group textarea {
    width: 100%;
    background: #404040;
    border: 1px solid #606060;
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.2s ease;
}

.property-group input[type="color"] {
    width: 40px;
    height: 28px;
    padding: 2px;
    background: none;
}

.property-group input:focus,
.property-group select:focus,
.property-group textarea:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.property-group textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.property-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-input-group input,
.property-input-group select {
    flex: 1;
}

.keyframe-btn {
    width: 24px;
    height: 24px;
    background: #404040;
    border: 1px solid #606060;
    color: #888888;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.keyframe-btn:hover {
    background: #505050;
    border-color: #707070;
}

.keyframe-btn.active {
    background: #ffcc00;
    border-color: #ffdd22;
    color: #000000;
}

.keyframe-btn.active:hover {
    background: #ffdd22;
}

.transition-btn {
    width: 24px;
    height: 24px;
    background: #404040;
    border: 1px solid #606060;
    color: #888888;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transition-btn:hover {
    background: #505050;
    border-color: #707070;
}

.transition-btn.has-curve {
    background: #ff4444;
    border-color: #ff6666;
    color: #ffffff;
}

.transition-btn.has-curve:hover {
    background: #ff6666;
}

.transition-btn:disabled {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #555555;
    cursor: not-allowed;
    opacity: 0.5;
}

.transition-btn:disabled:hover {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

/* Alignment Buttons */
.alignment-buttons {
    display: flex;
    gap: 2px;
}

.alignment-btn {
    width: 32px;
    height: 24px;
    background: #404040;
    border: 1px solid #606060;
    color: #cccccc;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alignment-btn:hover {
    background: #505050;
    border-color: #707070;
    color: #ffffff;
}

.alignment-btn.active {
    background: #0078d4;
    border-color: #106ebe;
    color: #ffffff;
}

.alignment-btn.active:hover {
    background: #106ebe;
}

.alignment-btn .material-symbols-outlined {
    font-size: 16px;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-container input[type="range"] {
    flex: 1;
    min-width: 80px;
    max-width: 150px;
}

.axis-control {
    margin-bottom: 12px;
    padding: 8px;
    background: #2b2b2b;
    border-radius: 4px;
    border: 1px solid #404040;
}

.axis-control label {
    font-size: 11px;
    color: #cccccc;
    margin-bottom: 4px;
}

.axis-control .range-container {
    margin-top: 4px;
}

.axis-control input[type="range"] {
    width: 100%;
    margin: 4px 0;
}

.axis-control input[type="number"] {
    width: 70px;
    padding: 8px 10px;
    font-size: 12px;
    background: #404040;
    border: 1px solid #606060;
    color: #ffffff;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.axis-control input[type="number"]:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.feature-control {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #2b2b2b;
    border-radius: 4px;
    border: 1px solid #404040;
    transition: background-color 0.2s ease;
}

.feature-control:hover {
    background: #3b3b3b;
}

.feature-control input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    accent-color: #0078d4;
}

.feature-control label {
    font-size: 11px;
    color: #ffffff;
    margin-bottom: 0;
    cursor: pointer;
    flex: 1;
}

.feature-description {
    font-size: 10px;
    color: #888888;
    margin-top: 2px;
}

.feature-tag {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    font-weight: bold;
    color: #666666;
    background: rgba(0, 120, 212, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
    display: inline-block;
}

/* Curve Editor */
#curveEditor {
    background: #404040;
    border: 1px solid #606060;
    border-radius: 4px;
    cursor: crosshair;
    margin-bottom: 12px;
}

.curve-controls {
    display: flex;
    gap: 8px;
}

.curve-controls button {
    background: #404040;
    border: 1px solid #606060;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.curve-controls button:hover {
    background: #505050;
}

/* Timeline Divider */
.timeline-divider {
    height: 6px;
    background: #404040;
    cursor: ns-resize;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #555;
    border-bottom: 1px solid #555;
    transition: background-color 0.2s ease;
}

.timeline-divider:hover {
    background: #555;
}

.timeline-divider.dragging {
    background: #666;
}

.divider-handle {
    width: 40px;
    height: 3px;
    background: #888;
    border-radius: 2px;
    pointer-events: none;
}

.timeline-divider:hover .divider-handle {
    background: #aaa;
}

/* Timeline */
#timeline {
    height: 220px;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    min-height: 100px;
    /* Minimum height to prevent collapsing */
}

#timelineLayout {
    flex: 1;
    display: flex;
    height: 100%;
}

#timelineLeftColumn {
    width: 150px;
    background: #2b2b2b;
    border-right: 1px solid #404040;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

#timelineHeaderLeft {
    height: 32px;
    background: #2b2b2b;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.layer-names-header {
    font-size: 12px;
    color: #cccccc;
    font-weight: 500;
}

#timelineLayerNames {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Hide scrollbar while maintaining scroll functionality */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* Internet Explorer 10+ */
}

#timelineLayerNames::-webkit-scrollbar {
    display: none;
    /* WebKit */
}

#timelineRightColumn {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Allow flex item to shrink below content width */
}

#timelineHeader {
    height: 32px;
    background: #2b2b2b;
    border-bottom: 1px solid #404040;
    position: relative;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    /* Hide scrollbar while maintaining scroll functionality */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* Internet Explorer 10+ */
}

#timelineHeader::-webkit-scrollbar {
    display: none;
    /* WebKit */
}

#timelineContainer {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    width: 100%;
    /* Constrain to parent width */
}

#timelineContent {
    display: flex;
    flex-direction: column;
    width: auto;
}

#timeRuler {
    height: 100%;
    position: relative;
    flex-shrink: 0;
    background: #121212;
}

.time-mark {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: #606060;
    pointer-events: none;
}

.time-label {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
    color: #cccccc;
    pointer-events: none;
}

#timeCursor {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #ff6b00;
    cursor: ew-resize;
    z-index: 100;
    box-shadow: 0 0 4px rgba(255, 107, 0, 0.5);
    pointer-events: auto;
}

#timeCursor::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #ff6b00;
}

.cursor-extension {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #ff6b00;
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
}

#timelineLayers {
    flex: 1;
    overflow-y: visible;
    overflow-x: hidden;
}

.timeline-layer-group {
    border-bottom: 1px solid #404040;
}

.timeline-layer {
    height: 24px;
    position: relative;
    background: #1e1e1e;
}

.timeline-layer.main-layer {
    height: 32px;
    background: #252525;
}

.timeline-layer.sub-layer {
    height: 20px;
    border-bottom: 1px solid #333333;
}

.timeline-layer-name {
    height: 24px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #cccccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #2b2b2b;
}

.timeline-layer-name.main-layer {
    height: 32px;
    font-size: 12px;
    font-weight: 500;
    background: #333333;
}

.timeline-layer-name.sub-layer {
    height: 20px;
    padding-left: 20px;
    background: #2b2b2b;
    border-bottom: 1px solid #333333;
    color: #aaaaaa;
}

/* Timeline Expand/Collapse */
.expand-button {
    color: #888888;
    margin-right: 6px;
    font-size: 10px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.expand-button:hover {
    color: #cccccc;
}

.timeline-layer-name.main-layer:hover .expand-button {
    color: #cccccc;
}

/* Collapsed Timeline Layer */
.timeline-layer.collapsed {
    background: #252525;
}

/* Selected Layer Indication */
.timeline-layer-group.selected .timeline-layer-name.main-layer {
    background: #444444;
}

.timeline-layer-group.selected .timeline-layer.main-layer {
    background: #333333;
}

/* Collapsed Keyframes */
.collapsed-keyframe {
    background: #666666;
    border: 1px solid #888888;
    opacity: 0.8;
}

.collapsed-keyframe:hover,
.collapsed-keyframe.highlighted {
    background: #ff6b00;
    border-color: #ff8533;
    opacity: 1;
    box-shadow: 0 0 6px rgba(255, 107, 0, 0.6);
    transform: scale(1.1);
    z-index: 10;
}

.layer-header {
    width: 151px;
    background: #2b2b2b;
    border-right: 1px solid #404040;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #cccccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-content {
    position: relative;
    background: #1e1e1e;
    flex: 1;
}

.keyframe {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #0078d4;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    transition: all 0.2s ease;
}

.keyframe:hover {
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.4);
}

.keyframe.selected {
    background: #dddddd;
    border-color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.4);
}

.keyframe.current {
    border-color: #ff6b00;
    box-shadow: 0 0 16px rgba(255, 107, 0, 0.8), 0 0 0 2px rgba(255, 107, 0, 0.4), 0 0 32px rgba(255, 107, 0, 0.3);
    transform: translateY(-50%) scale(1.2);
    z-index: 10;
}

.keyframe-span {
    position: absolute;
    height: 4px;
    background: linear-gradient(to right, #0078d4, #106ebe);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    border-radius: 2px;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #2b2b2b;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    color: #ffffff;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.4);
    position: relative;
}

.modal-content h2 {
    margin-bottom: 16px;
    color: #ff6b00;
    font-size: 18px;
}

.modal-content ul {
    margin: 16px 0;
    padding-left: 20px;
}

.modal-content li {
    margin-bottom: 4px;
    color: #cccccc;
}

.modal-content button {
    background: #0078d4;
    border: none;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 16px;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.modal-content button:hover {
    background: #106ebe;
}

.close {
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #cccccc;
    line-height: 1;
    margin-top: -4px;
}

.close:hover {
    color: #ffffff;
}

/* Export Format Modal */
#formatOptions {
    margin: 20px 0;
}

.format-option {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #404040;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-option:hover {
    background: #353535;
    border-color: #505050;
}

.format-option.selected {
    background: rgba(0, 120, 212, 0.2);
    border-color: #0078d4;
}

.format-option input[type="radio"] {
    margin-right: 12px;
    accent-color: #0078d4;
}

.format-info {
    flex: 1;
}

.format-name {
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
}

.format-description {
    font-size: 11px;
    color: #cccccc;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-buttons button {
    margin-top: 0;
}

.modal-buttons button:disabled {
    background: #505050;
    cursor: not-allowed;
}

.modal-buttons button:disabled:hover {
    background: #505050;
}

/* Compatibility Modal */
.compatibility-modal {
    backdrop-filter: blur(8px);
}

.compatibility-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.compatibility-content h4 {
    color: #ffffff;
    margin: 16px 0 8px 0;
    font-size: 14px;
}

.missing-features {
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid #d32f2f;
    border-radius: 4px;
    padding: 12px;
    margin: 16px 0;
}

.missing-features h4 {
    color: #f48fb1;
    margin-top: 0;
}

.limited-features {
    background: rgba(245, 124, 0, 0.1);
    border: 1px solid #f57c00;
    border-radius: 4px;
    padding: 12px;
    margin: 16px 0;
}

.limited-features h4 {
    color: #ffcc02;
    margin-top: 0;
}

.compatible-browsers {
    background: rgba(0, 120, 212, 0.1);
    border: 1px solid #0078d4;
    border-radius: 4px;
    padding: 12px;
    margin: 16px 0;
}

.compatible-browsers h4 {
    color: #64b5f6;
    margin-top: 0;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-buttons button {
    margin: 0;
}

/* About Modal */
.about-content {
    max-height: 70vh;
    overflow-y: auto;
}

.about-content h3 {
    color: #ffffff;
    margin: 20px 0 12px 0;
    font-size: 14px;
    border-bottom: 1px solid #404040;
    padding-bottom: 6px;
}

.about-content ul {
    margin: 0 0 16px 0;
    padding-left: 16px;
}

.about-content li {
    margin-bottom: 6px;
    color: #cccccc;
    font-size: 12px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
    font-size: 12px;
}

.shortcuts-grid div {
    display: flex;
    align-items: center;
    color: #cccccc;
}

.shortcuts-grid kbd {
    background: #404040;
    border: 1px solid #555555;
    border-radius: 3px;
    padding: 2px 6px;
    margin-right: 8px;
    font-size: 10px;
    color: #ffffff;
    font-family: monospace;
}

.about-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #404040;
}

.about-footer p {
    margin: 0 0 12px 0;
    color: #cccccc;
    font-size: 12px;
}

.github-link {
    display: inline-flex;
    align-items: center;
    color: #0078d4;
    text-decoration: none;
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid #0078d4;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.github-link:hover {
    background: rgba(0, 120, 212, 0.1);
    border-color: #106ebe;
    color: #106ebe;
}

.github-link .material-symbols-outlined {
    font-size: 16px;
    margin-right: 6px;
}

#aboutBtn {
    background: transparent;
    border: 1px solid #404040;
    color: #cccccc;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    margin-left: 16px;
}

#aboutBtn:hover {
    background: #353535;
    border-color: #505050;
    color: #ffffff;
}

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

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #505050;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    max-width: 350px;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.notification.info {
    background: #1976d2;
}

.notification.success {
    background: #388e3c;
}

.notification.warning {
    background: #f57c00;
}

.notification.error {
    background: #d32f2f;
}

/* Responsive */
@media (max-width: 1400px) {
    #rightPanel {
        width: 280px;
    }
}

@media (max-width: 1200px) {
    #rightPanel {
        width: 260px;
    }

    #leftToolbar {
        width: 70px;
    }

    .tool-btn {
        width: 54px;
        height: 42px;
    }

    .upload-btn {
        width: 54px;
        height: 42px;
    }
}

@media (max-width: 900px) {
    #rightPanel {
        display: none;
    }
}

/* Transition Editor Modal */
#transitionModal .modal-content {
    max-width: 600px;
    width: 95%;
}

.transition-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

.curve-preview {
    display: flex;
    justify-content: center;
}

#transitionCanvas {
    border: 1px solid #606060;
    background: #2a2a2a;
    border-radius: 4px;
    cursor: crosshair;
}

.curve-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
}

.control-inputs {
    display: flex;
    gap: 10px;
}

.control-inputs input {
    flex: 1;
    padding: 8px;
    background: #404040;
    border: 1px solid #606060;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
}

.control-inputs input:focus {
    outline: none;
    border-color: #0078d4;
}

.preset-curves {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 8px 12px;
    background: #404040;
    border: 1px solid #606060;
    border-radius: 4px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: #505050;
    border-color: #707070;
}

.preset-btn:active {
    background: #0078d4;
    border-color: #0088ff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #606060;
}

.btn-primary {
    padding: 10px 20px;
    background: #0078d4;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #106ebe;
}

.btn-secondary {
    padding: 10px 20px;
    background: #404040;
    border: 1px solid #606060;
    border-radius: 4px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #505050;
    border-color: #707070;
}