/* ==========================================================================
   ARCHITAPE WIRING DIAGRAM GENERATOR
   Independent stylesheet for the interactive wiring tool.
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

/* Unified Variables */
:root {
    --primary-color: #559ab3;
    --primary-dark: #3d7a8f;
    --primary-light: #7bb3c7;
    --primary-lighter: #ffffff;
    --at-accent: #73c5d8;
    --at-accent-light: #e6f7fb;
    --text-dark: #1a1a1a;
    --text-main: #0f172a;
    --text-medium: #4a4a4a;
    --text-light: #6b6b6b;
    --border-color: #e0e0e0;
    --shadow-overlay: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --at-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
    color: var(--text-main);
    background-color: #f8fafc;
    line-height: 1.6;
}

/* Layout */
.wiring-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    min-height: 80vh;
}

/* Sidebar / Controls */
.controls-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px var(--shadow-overlay);
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.controls-panel h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-medium);
}

.control-group select {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--at-transition);
}

.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(85, 154, 179, 0.2);
}

/* Diagram Workspace */
.diagram-workspace {
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 600px;
}

.workspace-header {
    padding: 20px 30px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-area {
    flex: 1;
    position: relative;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

#wiring-canvas {
    max-width: 100%;
    height: auto;
}

/* Mode Switcher */
.mode-btn.active {
    background: white !important;
    color: var(--primary-color) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mode-btn:not(.active):hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Enclosure Markers */
.dim-line {
    stroke: var(--primary-color);
    stroke-width: 1;
    stroke-dasharray: 4, 2;
}

.dim-text {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    fill: var(--primary-color);
}

/* UI Elements */
.btn-primary {
    background: var(--primary-color);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--at-transition);
    text-align: center;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(85, 154, 179, 0.3);
}

/* Legend & Components */
.schematic-node {
    stroke: var(--primary-color);
    stroke-width: 2;
    fill: white;
}

.connection-line {
    stroke: #94a3b8;
    stroke-width: 3;
    fill: none;
}

/* Toolbox Grid */
.toolbox-grid {
    margin-top: 10px;
}

.add-comp-btn {
    transition: var(--at-transition);
    border: 1px solid var(--border-color);
    color: var(--text-medium);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-comp-btn:hover {
    background: var(--at-accent-light) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.smart-indicator {
    transition: var(--at-transition);
}

.smart-indicator:hover {
    transform: scale(1.02);
}

@media (max-width: 1024px) {
    .wiring-container {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        position: static;
    }
}