/* Custom Framework Architecture Scope Base Tokens */
.awc-fw-wrapper {
    --awc-primary: #2ea3f2;
    --awc-primary-hover: #1e87d2;
    --awc-text-dark: #333333;
    --awc-text-muted: #666666;
    --awc-border-color: #dddddd;
    --awc-bg-card: #ffffff;
    --awc-bg-stripe: #f8f9fa;
    --awc-success: #25a845;
    --awc-error-color: #ff5e5e;
    --awc-radius: 6px;
    --awc-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    
    max-width: 800px;
    margin: 40px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.awc-fw-wrapper * {
    box-sizing: border-box;
}

.awc-fw-card {
    background: var(--awc-bg-card);
    border: 1px solid var(--awc-border-color);
    border-radius: var(--awc-radius);
    padding: 30px;
    box-shadow: var(--awc-shadow);
}

.awc-fw-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--awc-text-dark);
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--awc-bg-stripe);
    padding-bottom: 15px;
}

/* Shape Picker Matrix Engine */
.awc-shape-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 10px;
    margin-bottom: 25px;
}

.awc-shape-tile {
    border: 1px solid var(--awc-border-color);
    border-radius: var(--awc-radius);
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.awc-shape-tile span {
    font-size: 12px;
    font-weight: 600;
    color: var(--awc-text-muted);
}

.awc-shape-tile:hover {
    border-color: var(--awc-primary);
    background: var(--awc-bg-stripe);
}

.awc-shape-tile.active {
    border-color: var(--awc-primary);
    background: #f0f9ff;
    box-shadow: 0 0 0 2px rgba(46, 163, 242, 0.2);
}

.awc-shape-tile.active span {
    color: var(--awc-primary);
}

.awc-icon {
    width: 32px;
    height: 32px;
    position: relative;
    background: #ccc;
    transition: background 0.2s;
}

.awc-shape-tile.active .awc-icon {
    background: var(--awc-primary);
}

.icon-block { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); background: #999; }
.icon-parallelogram { clip-path: polygon(25% 100%, 100% 100%, 75% 0%, 0% 0%); background: #999; }
.icon-trapezoid { clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%); background: #999; }
.icon-triangle { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); background: #999; }
.icon-cylinder { clip-path: inset(0% 15% 0% 15% round 15px 15px 15px 15px); background: #999; }
.icon-ellipse { border-radius: 50%; transform: scaleY(0.6); background: #999; }
.icon-sphere { border-radius: 50%; background: #999; }
.icon-pipe { border-radius: 50%; border: 8px solid #999; background: transparent !important; box-sizing: border-box; }
.awc-shape-tile.active .icon-pipe { border-color: var(--awc-primary); }

/* Structural Form Grids */
.awc-fw-grid { display: grid; gap: 20px; margin-bottom: 20px; }
.awc-fw-grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.awc-fw-grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.awc-fw-field { margin-bottom: 20px; }
.awc-fw-field label { display: block; font-size: 14px; font-weight: 600; color: var(--awc-text-dark); margin-bottom: 8px; }
.awc-fw-field select, .awc-fw-field input[type="number"] { width: 100%; height: 45px; padding: 10px 15px; border: 1px solid var(--awc-border-color); border-radius: var(--awc-radius); font-size: 15px; }
.awc-dim-input { display: none; }

/* Composition Sections & Visual Matrix Layout Grids */
.awc-fw-section-header { font-size: 16px; text-transform: uppercase; letter-spacing: 0.5px; border-left: 3px solid var(--awc-primary); padding-left: 10px; margin-top: 25px; }

.awc-priority-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 12px;
}

.awc-fw-matrix { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
    border: 1px solid var(--awc-border-color); 
    padding: 15px; 
    border-radius: var(--awc-radius); 
    margin-top: 12px; 
}

.awc-fw-matrix-row { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: #fbfbfb; 
    border: 1px solid #eaeaea; 
    padding: 10px 15px; 
    border-radius: var(--awc-radius); 
}

.awc-fw-matrix-row.awc-highlight-row { 
    background: #f0f9ff; 
    border-color: #bae6fd; 
    font-weight: bold;
    margin-top: 2px;
    margin-bottom: 2px;
}

.awc-fw-mat-name { font-size: 14px; color: var(--awc-text-dark); font-weight: 500; }
.awc-fw-input-wrapper { display: flex; align-items: center; width: 110px; position: relative; }
.awc-fw-input-wrapper input { width: 100% !important; height: 36px !important; padding: 2px 25px 2px 10px !important; font-size: 14px !important; text-align: right; border-radius: var(--awc-radius) !important; border: 1px solid var(--awc-border-color); background: #fff; }
.awc-fw-input-wrapper input[readonly] { background: #e9ecef; color: #495057; }
.awc-fw-addon { position: absolute; right: 10px; font-size: 12px; color: var(--awc-text-muted); pointer-events: none; }
.awc-fw-status-bar { margin-top: 12px; font-size: 14px; font-weight: bold; text-align: right; }

/* Control Buttons Layout */
.awc-action-buttons-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
    margin-bottom: 10px;
}

.awc-fw-btn { width: 100%; height: 50px; background: var(--awc-primary); color: #fff; border: none; border-radius: var(--awc-radius); font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; box-shadow: 0 4px 12px rgba(46, 163, 242, 0.2); }
.awc-fw-btn:hover { background: var(--awc-primary-hover); }

.awc-fw-btn-secondary { width: 100%; height: 50px; background: #fff; color: var(--awc-text-dark); border: 1px solid var(--awc-border-color); border-radius: var(--awc-radius); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.awc-fw-btn-secondary:hover { background: var(--awc-bg-stripe); border-color: #bbb; }

.awc-fw-alert-error { display: none; margin-top: 15px; padding: 12px 15px; background: #fff5f5; border-left: 4px solid var(--awc-error-color); color: #cc0000; font-size: 14px; border-radius: 0 var(--awc-radius) var(--awc-radius) 0; }

/* Results Visual Card Blocks */
.awc-fw-results-card { display: none; background: var(--awc-bg-card); border: 1px solid var(--awc-border-color); border-radius: var(--awc-radius); padding: 25px; margin-top: 25px; box-shadow: var(--awc-shadow); }
.awc-fw-results-card h3 { font-size: 18px; font-weight: 600; margin-top: 20px; color: var(--awc-text-dark); }
.awc-fw-results-card h3:first-child { margin-top: 0; }
.awc-fw-results-list { list-style: none; padding: 0; margin: 0 0 20px 0; border: 1px solid var(--awc-border-color); border-radius: var(--awc-radius); overflow: hidden; }
.awc-fw-results-list li { padding: 12px 15px; background: #fff; border-bottom: 1px solid var(--awc-border-color); display: flex; justify-content: space-between; font-size: 14px; }
.awc-fw-results-list li:nth-child(even) { background: var(--awc-bg-stripe); }
.awc-fw-total-box { background: #f0f9ff; border: 1px solid #bae6fd; padding: 15px 20px; border-radius: var(--awc-radius); display: flex; justify-content: space-between; align-items: center; font-size: 16px; color: #0369a1; }

/* Reference Densities Modal Layout Overlay Sheet */
.awc-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 99999; justify-content: center; align-items: center; padding: 20px; }
.awc-modal-content { background: #fff; border-radius: var(--awc-radius); max-width: 500px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,0.15); animation: awcFadeIn 0.25s ease; }
.awc-modal-header { padding: 15px 20px; border-bottom: 1px solid var(--awc-border-color); display: flex; justify-content: space-between; align-items: center; }
.awc-modal-header h3 { margin: 0; font-size: 18px; color: var(--awc-text-dark); }
.awc-modal-close-btn { font-size: 24px; font-weight: bold; color: #aaa; cursor: pointer; line-height: 1; }
.awc-modal-close-btn:hover { color: #333; }
.awc-modal-body { padding: 20px; overflow-y: auto; font-size: 14px; color: var(--awc-text-muted); }
.awc-density-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.awc-density-table th, .awc-density-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--awc-border-color); }
.awc-density-table th { background: var(--awc-bg-stripe); font-weight: 600; color: var(--awc-text-dark); }
.awc-density-table tr:hover td { background: #fdfdfd; }

@keyframes awcFadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Fluid Breakpoints Media Queries Optimization Engine */
@media (max-width: 768px) {
    .awc-shape-picker-grid { grid-template-columns: repeat(2, 1fr); }
    .awc-fw-matrix { grid-template-columns: repeat(2, 1fr); }
    .awc-action-buttons-container { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 480px) {
    .awc-shape-picker-grid { grid-template-columns: 1fr; }
    .awc-priority-box { grid-template-columns: 1fr; }
    .awc-fw-matrix { grid-template-columns: 1fr; }
}
