:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --border: #4a4a4a;
    --success: #10b981;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

/* Form Sections */
.form-section {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

/* Shape Grid */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.shape-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shape-option:hover {
    border-color: var(--accent);
    background-color: var(--bg-primary);
}

.shape-option input[type="radio"] {
    display: none;
}

.shape-option input[type="radio"]:checked + span {
    color: var(--accent);
    font-weight: bold;
}

.shape-option input[type="radio"]:checked ~ span::before {
    content: '✓ ';
}

.shape-option span {
    text-align: center;
    color: var(--text-primary);
}

/* Input Rows and Groups */
.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.input-group input,
.input-group select {
    padding: 0.75rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.input-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 1rem 2rem;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.calculate-btn:hover {
    background-color: var(--accent-hover);
}

.calculate-btn:active {
    transform: translateY(1px);
}

/* Results Section */
.results {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    border: 2px solid var(--accent);
}

.result-card {
    background-color: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.result-card h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.result-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.result-value {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.highlight {
    color: var(--success);
}

/* SVG Diagram Container */
.diagram-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.diagram-container svg {
    max-width: 100%;
    height: auto;
}

/* Cut List */
.cut-list {
    background-color: var(--bg-primary);
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.cut-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .shape-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0.5rem;
    }

    .form-section {
        padding: 1rem;
    }

    .results {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .shape-grid {
        grid-template-columns: 1fr;
    }

    .calculate-btn {
        font-size: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results {
    animation: fadeIn 0.5s ease;
}
