/**
 * Circuit Designer - Modern Responsive Styles
 * Dark theme with cyan/turquoise accents and educational focus
 */

/* ===== PAGE LAYOUT ===== */
.circuit-page {
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== HERO SECTION ===== */
.circuit-hero {
    position: relative;
    padding: 4rem 2rem 3rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 35vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #151515 100%);
}

.circuit-hero .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(78, 205, 196, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(227, 61, 148, 0.08) 0%, transparent 50%);
}

.circuit-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(#333 0.5px, transparent 0.5px);
    background-size: 40px 40px;
    opacity: 0.02;
    pointer-events: none;
}

.circuit-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    text-align: center;
}

.circuit-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #ffffff;
}

.circuit-title .title-accent {
    background: linear-gradient(135deg, #4ecdc4 0%, #e33d94 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.circuit-subtitle {
    font-size: 1rem;
    color: #b0b0b0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== MAIN WORKSPACE ===== */
.circuit-section {
    padding: 2rem;
    max-width: 100%;
    margin: 0 auto;
}

.circuit-workspace-container {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 1.5rem;
    height: calc(100vh - 300px);
    min-height: 600px;
}

/* ===== SIDEBAR: COMPONENT LIBRARY ===== */
.circuit-sidebar {
    background: #1a1a1a;
    border: 1px solid #202020;
    border-radius: 8px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 1.5rem;
}

.sidebar-header h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: #4ecdc4;
}

.component-search {
    width: 100%;
    padding: 0.75rem;
    background: #151515;
    border: 1px solid #202020;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.9rem;
}

.component-search:focus {
    outline: none;
    border-color: #4ecdc4;
    background: #1f1f1f;
}

/* ===== CATEGORIES ===== */
.component-categories {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category {
    border: 1px solid #202020;
    border-radius: 4px;
    overflow: hidden;
}

.category-header {
    width: 100%;
    background: #1f1f1f;
    border: none;
    color: #4ecdc4;
    padding: 0.75rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.category-header:hover {
    background: #202020;
    color: #72e8e0;
}

.category-icon {
    font-size: 1.2rem;
}

.category-items {
    background: #151515;
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
}

/* ===== COMPONENT ITEMS ===== */
.component-item {
    background: #0f0f0f;
    border: 1px solid #202020;
    border-radius: 4px;
    padding: 0.75rem;
    cursor: grab;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.component-item:hover {
    background: #1a1a1a;
    border-color: #4ecdc4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.1);
}

.component-item:active {
    cursor: grabbing;
}

.component-icon {
    font-size: 1.5rem;
}

.component-name {
    font-size: 0.8rem;
    color: #b0b0b0;
    text-align: center;
    font-weight: 500;
}

/* ===== CANVAS AREA ===== */
.circuit-canvas-area {
    background: #151515;
    border: 1px solid #202020;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== TOOLBAR ===== */
.circuit-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: #1a1a1a;
    border-bottom: 1px solid #202020;
    flex-wrap: wrap;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: #0f0f0f;
    border: 1px solid #202020;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #1a1a1a;
    border-color: #4ecdc4;
    color: #4ecdc4;
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.2);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #202020;
    margin: 0 0.25rem;
}

.toolbar-select {
    padding: 0.6rem 0.75rem;
    background: #0f0f0f;
    border: 1px solid #202020;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-select:hover {
    border-color: #4ecdc4;
}

.toolbar-select:focus {
    outline: none;
    border-color: #4ecdc4;
}

/* ===== CANVAS ===== */
#circuit-canvas {
    flex: 1;
    background: #ffffff;
    cursor: default;
    display: block;
}

/* ===== VALIDATION PANEL ===== */
.validation-panel {
    background: #1a1a1a;
    border-top: 1px solid #202020;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    display: block;
}

.validation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.validation-header h4 {
    margin: 0;
    color: #4ecdc4;
    font-size: 0.95rem;
}

.close-btn {
    background: none;
    border: none;
    color: #b0b0b0;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #e33d94;
}

/* ===== VALIDATION MESSAGES ===== */
.validation-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.validation-message {
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid;
    font-size: 0.85rem;
}

.msg-error {
    background: rgba(233, 69, 96, 0.1);
    border-left-color: #e94560;
    color: #ff8a9b;
}

.msg-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #ffe082;
}

.msg-info {
    background: rgba(78, 205, 196, 0.1);
    border-left-color: #4ecdc4;
    color: #72e8e0;
}

.msg-success {
    background: rgba(76, 175, 80, 0.1);
    border-left-color: #4caf50;
    color: #81c784;
}

.msg-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.msg-education {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    line-height: 1.5;
}

.msg-education strong {
    display: block;
    margin-top: 0.5rem;
    color: #4ecdc4;
}

.msg-education p {
    margin: 0.25rem 0;
}

.msg-education em {
    color: #e33d94;
}

/* ===== RIGHT INFO PANEL ===== */
.circuit-info-panel {
    background: #1a1a1a;
    border: 1px solid #202020;
    border-radius: 8px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-header h3 {
    margin: 0;
    color: #4ecdc4;
    font-size: 1.1rem;
}

/* ===== COMPONENT PROPERTIES ===== */
.component-properties {
    background: #0f0f0f;
    border: 1px solid #202020;
    border-radius: 4px;
    padding: 1rem;
}

#selected-component-name {
    margin: 0 0 0.75rem;
    color: #4ecdc4;
    font-size: 1rem;
}

#component-details {
    font-size: 0.8rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

#component-details dl {
    margin: 0;
}

#component-details dt {
    color: #72e8e0;
    font-weight: 600;
    margin-top: 0.5rem;
}

#component-details dd {
    margin: 0.25rem 0 0 0;
    color: #b0b0b0;
}

.component-education {
    background: rgba(78, 205, 196, 0.03);
    border: 1px solid rgba(78, 205, 196, 0.15);
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.5;
}

.component-education strong {
    color: #4ecdc4;
    display: block;
    margin-top: 0.5rem;
}

.component-education ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.component-education li {
    margin: 0.25rem 0;
    color: #b0b0b0;
}

/* ===== CIRCUIT STATS ===== */
.circuit-stats {
    background: #0f0f0f;
    border: 1px solid #202020;
    border-radius: 4px;
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(78, 205, 196, 0.03);
    border-radius: 3px;
}

.stat-label {
    color: #b0b0b0;
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-label + span {
    font-weight: 700;
    color: #4ecdc4;
}

.status-ok {
    color: #4caf50 !important;
}

.status-warning {
    color: #ffc107 !important;
}

.status-error {
    color: #e94560 !important;
}

.status-success {
    color: #4caf50 !important;
}

.status-neutral {
    color: #b0b0b0 !important;
}

/* ===== INFO SECTION ===== */
.info-section {
    background: #0f0f0f;
    border: 1px solid #202020;
    border-radius: 4px;
    padding: 1rem;
}

.info-section h4 {
    margin: 0 0 0.75rem;
    color: #4ecdc4;
    font-size: 0.95rem;
}

.tips-list {
    margin: 0;
    padding-left: 1.25rem;
    list-style: none;
}

.tips-list li {
    margin: 0.5rem 0;
    color: #b0b0b0;
    font-size: 0.85rem;
    position: relative;
    padding-left: 1rem;
}

.tips-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #4ecdc4;
    font-weight: bold;
}

.resource-link {
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.resource-link a {
    color: #4ecdc4;
    text-decoration: none;
    transition: color 0.2s;
}

.resource-link a:hover {
    color: #72e8e0;
    text-decoration: underline;
}

/* ===== EDUCATION CARD ===== */
.education-card {
    background: rgba(227, 61, 148, 0.03);
    border-left: 2px solid #e33d94;
    padding: 0.75rem;
    border-radius: 3px;
}

.education-card h5 {
    margin: 0 0 0.5rem;
    color: #e33d94;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1400px) {
    .circuit-workspace-container {
        grid-template-columns: 200px 1fr 250px;
    }
    
    .component-item {
        padding: 0.5rem;
    }
    
    .component-name {
        font-size: 0.75rem;
    }
}

@media (max-width: 1024px) {
    .circuit-workspace-container {
        grid-template-columns: 150px 1fr;
        height: auto;
        min-height: 500px;
    }
    
    .circuit-info-panel {
        grid-column: 1 / -1;
        max-height: 300px;
    }
    
    .sidebar-header h3 {
        font-size: 0.95rem;
    }
    
    .toolbar-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .circuit-section {
        padding: 1rem;
    }
    
    .circuit-workspace-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1rem;
    }
    
    .circuit-sidebar {
        order: -1;
        padding: 1rem;
        max-height: 300px;
    }
    
    .circuit-canvas-area {
        min-height: 400px;
    }
    
    .circuit-info-panel {
        max-height: 300px;
    }
    
    .circuit-toolbar {
        gap: 0.25rem;
    }
    
    .toolbar-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .toolbar-divider {
        display: none;
    }
    
    .toolbar-select {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .circuit-title {
        font-size: 1.5rem;
    }
    
    .circuit-sidebar,
    .circuit-info-panel {
        font-size: 0.8rem;
    }
    
    .circuit-canvas-area {
        min-height: 300px;
    }
}

/* ===== SCROLLBAR STYLING ===== */
.circuit-sidebar::-webkit-scrollbar,
.circuit-info-panel::-webkit-scrollbar,
.validation-panel::-webkit-scrollbar {
    width: 6px;
}

.circuit-sidebar::-webkit-scrollbar-track,
.circuit-info-panel::-webkit-scrollbar-track,
.validation-panel::-webkit-scrollbar-track {
    background: transparent;
}

.circuit-sidebar::-webkit-scrollbar-thumb,
.circuit-info-panel::-webkit-scrollbar-thumb,
.validation-panel::-webkit-scrollbar-thumb {
    background: #4ecdc4;
    border-radius: 3px;
}

.circuit-sidebar::-webkit-scrollbar-thumb:hover,
.circuit-info-panel::-webkit-scrollbar-thumb:hover,
.validation-panel::-webkit-scrollbar-thumb:hover {
    background: #72e8e0;
}
