:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --prismatic-color: #7f8c8d;
    --border-color: #e0e6ed;
    --text-color: #333333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 40px 20px;
}

.container {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

@media (max-width: 850px) {
    .container {
        grid-template-columns: 1fr;
    }
}

h2 {
    grid-column: 1 / -1;
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    text-align: center;
}

.section-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
    font-weight: 500;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.3s;
    background-color: #fff;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.results-panel {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-label {
    font-weight: 500;
    font-size: 0.95em;
}

.result-value {
    font-weight: 700;
    color: var(--accent-color);
}

.pack-architecture {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pack-architecture h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 400;
}

.pack-architecture .arch-value {
    font-size: 2em;
    font-weight: 700;
    margin-top: 5px;
    color: #2ecc71;
}

/* 3D Visualizer Styles */
.visualizer-section {
    grid-column: 1 / -1;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    min-height: 400px;
}

.pack-grid-container {
    perspective: 1500px;
    margin-top: 60px;
    margin-bottom: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.pack-grid {
    display: grid;
    padding: 15px;
    background: rgba(44, 62, 80, 0.05);
    border-radius: 8px;
    /* Isometric Transformation */
    transform: rotateX(60deg) rotateZ(-45deg);
    transform-style: preserve-3d;
    box-shadow: 15px 15px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.cell-3d {
    position: relative;
    background-color: var(--accent-color);
    transform-style: preserve-3d;
}

/* Cylindrical specific styling */
.cell-cylindrical {
    border-radius: 50%;
}
.cell-cylindrical::after {
    content: '';
    position: absolute;
    top: 25%; left: 25%; right: 25%; bottom: 25%;
    background: #ecf0f1;
    border-radius: 50%;
}

/* Prismatic specific styling */
.cell-prismatic {
    border-radius: 2px;
    background-color: #bdc3c7;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Prismatic Terminals */
.cell-prismatic::before, .cell-prismatic::after {
    content: '';
    position: absolute;
    width: 20%;
    height: 20%;
    background: #7f8c8d;
    border-radius: 50%;
    top: 40%;
}
.cell-prismatic::before { left: 15%; }
.cell-prismatic::after { right: 15%; }

.viz-error {
    color: #e74c3c;
    font-weight: bold;
    margin-top: 20px;
    text-align: center;
    padding: 20px;
    background: #fadbd8;
    border-radius: 8px;
}

.dim-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
