:root {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --bg-color: #0a0a0a;
    --panel-bg: rgba(23, 23, 23, 0.85);
    --text-main: #fafafa;
    --text-muted: #a3a3a3;
    --border-color: rgba(255, 255, 255, 0.15);
    --accent-color: #f97316;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(249, 115, 22, 0.1), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(249, 115, 22, 0.05), transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    padding: 2rem 4rem; /* More breathing room on sides */
}

.container {
    max-width: 1700px; /* Instead of 100%, limit it nicely */
    width: 100%;
    margin: 0 auto; /* Center it */
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #f97316, #fdba74);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

.calculator-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.results-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: sticky;
    top: 1rem;
    height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.calculator-panel:hover, .results-panel:hover {
    box-shadow: 0 30px 60px -12px rgba(249, 115, 22, 0.15);
}

.input-group {
    background: rgba(10, 10, 10, 0.6);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.input-group:hover {
    transform: translateY(-2px);
    border-color: rgba(249, 115, 22, 0.4);
}

.input-group {
    background: rgba(15, 23, 42, 0.4);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.input-group:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}

.input-group h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-control {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-control label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control input[type="number"] {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
}

.form-control input[type="number"]:hover {
    border-color: rgba(249, 115, 22, 0.5);
    background: rgba(0, 0, 0, 1);
}

.form-control input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
    transform: translateY(-1px);
}

.checkbox-control {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.checkbox-control input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-control label {
    margin-bottom: 0;
    cursor: pointer;
}

.btn-calculate {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-calculate:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

/* Results Panel */
.results-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.results-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.result-card {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.primary-result {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(249, 115, 22, 0.2) 100%);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.primary-result:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px -10px rgba(249, 115, 22, 0.4);
}

.primary-result::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-25deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.result-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-details {
    flex: 2;
    min-width: 250px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
    background: rgba(10, 10, 10, 0.4);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.detail-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.canvas-container {
    background: rgba(5, 5, 5, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    overflow: hidden;
    position: relative;
    padding: 1rem;
}

.canvas-container h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

#preview-canvas {
    max-width: 100%;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}
