/* Panels - Left and Right Sidebars */

/* Left Panel */
.left-panel {
    width: 320px;
    background-color: var(--md-sys-color-surface);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    box-shadow: var(--md-sys-elevation-level-1);
    height: 100%;
    overflow-y: auto;
}

/* Right Panel */
.right-panel {
    width: 320px;
    background-color: var(--md-sys-color-surface);
    border-left: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    box-shadow: var(--md-sys-elevation-level-1);
    height: 100%;
    overflow-y: auto;
}

/* Panel Sections */
.panel-section {
    padding: var(--md-sys-spacing-lg);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-title {
    font-size: var(--md-sys-typescale-title-medium-size);
    font-weight: var(--md-sys-typescale-title-medium-weight);
    line-height: var(--md-sys-typescale-title-medium-line-height);
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--md-sys-spacing-md);
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-xs);
}

.panel-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    border-radius: 2px;
}

/* Aspect Ratio Controls */
.aspect-ratio-controls {
    margin-bottom: var(--md-sys-spacing-md);
}

/* Background Controls */
.background-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Properties Content */
.properties-content {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-md);
}

/* Canvas Section */
.canvas-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--md-sys-color-background);
    position: relative;
    overflow: hidden;
}

.canvas-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: var(--md-sys-spacing-lg);
}

@media (max-width: 768px) {
    .canvas-container {
        padding: var(--md-sys-spacing-md);
    }
}

.main-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-level-3);
    background-image: 
        linear-gradient(45deg, var(--md-sys-color-surface-variant) 25%, transparent 25%),
        linear-gradient(-45deg, var(--md-sys-color-surface-variant) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--md-sys-color-surface-variant) 75%),
        linear-gradient(-45deg, transparent 75%, var(--md-sys-color-surface-variant) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--md-sys-spacing-lg);
}

.canvas-bounds {
    position: absolute;
    border: 2px solid var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Shape Selection Bounding Box */
.shape-bounding-box {
    position: absolute;
    border: 2px solid var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-small);
    pointer-events: none;
    z-index: 10;
}

.shape-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--md-sys-color-primary);
    border: 2px solid var(--md-sys-color-surface);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    z-index: 11;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.shape-handle:hover {
    transform: scale(1.2);
    box-shadow: var(--md-sys-elevation-level-2);
}

.shape-handle.resize-nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.shape-handle.resize-ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.shape-handle.resize-sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

.shape-handle.resize-se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.shape-handle.rotate {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    cursor: grab;
}

.shape-handle.rotate:hover {
    cursor: grabbing;
}

/* Responsive Design */
@media (min-aspect-ratio: 3/2) {
    .left-panel,
    .right-panel {
        width: 360px;
    }
}

@media (max-width: 1200px) {
    .left-panel,
    .right-panel {
        width: 280px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        overflow-y: auto;
    }

    .left-panel,
    .right-panel {
        width: 100%;
        height: auto;
        max-height: none;
    }

    .panel-section {
        padding: var(--md-sys-spacing-md);
    }

    .canvas-section {
        flex: 1;
        min-height: 400px;
    }
}

/* Panel Scrollbars */
.panel-section::-webkit-scrollbar {
    width: 6px;
}

.panel-section::-webkit-scrollbar-track {
    background: transparent;
}

.panel-section::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-outline);
    border-radius: 3px;
}

.panel-section::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-outline-variant);
}

/* Panel Animations */
.panel-section {
    animation: slideIn 0.3s ease-out;
}

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

/* Panel Focus States */
.panel-section:focus-within {
    background-color: var(--md-sys-color-surface-variant);
}

/* Panel Hover Effects */
.panel-section:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Panel Transitions */
.panel-section {
    transition: background-color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Canvas Zoom Controls (for future implementation) */
.canvas-zoom-controls {
    position: absolute;
    bottom: var(--md-sys-spacing-lg);
    right: var(--md-sys-spacing-lg);
    display: flex;
    gap: var(--md-sys-spacing-xs);
    z-index: 20;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: var(--md-sys-elevation-level-1);
}

.zoom-btn:hover {
    background-color: var(--md-sys-color-surface-variant);
    box-shadow: var(--md-sys-elevation-level-2);
}

/* Canvas Grid (for future implementation) */
.canvas-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.1;
    background-image: 
        linear-gradient(var(--md-sys-color-outline) 1px, transparent 1px),
        linear-gradient(90deg, var(--md-sys-color-outline) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Canvas Rulers (for future implementation) */
.canvas-ruler {
    position: absolute;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    z-index: 5;
}

.canvas-ruler-horizontal {
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
}

.canvas-ruler-vertical {
    top: 0;
    left: 0;
    bottom: 0;
    width: 20px;
} 