:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --background-color: #f8f9fa;
    --text-color: #2b2d42;
    --text-light: #8d99ae;
    --white: #ffffff;
    --error-color: #ef233c;
    --success-color: #2a9d8f;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    line-height: 1.6;
}

.container {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 1200px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    margin-bottom: 2.5rem;
}

.container.single-view header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
}

.container.single-view .currency-btn {
    display: none;
}

.container.single-view .nav-wrapper {
    text-align: center;
}

h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(72, 149, 239, 0.15);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 1rem;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(63, 55, 201, 0.3);
}

button:active {
    transform: translateY(0);
}

.result-card {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: linear-gradient(to right, #e0fbfc, #e0f2f1);
    border-left: 5px solid var(--success-color);
    border-radius: 8px;
    text-align: center;
    animation: slideUp 0.4s ease-out;
}

.result-card h2 {
    color: var(--success-color);
    font-size: 1.5rem;
    margin: 0;
}

.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.price-row:last-child {
    border-bottom: none;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px dashed var(--success-color);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--success-color);
}

.price-row.adjustment {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.price-row .label {
    color: var(--text-light);
}

.price-row.final .label {
    color: var(--success-color);
}

.result-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.error-card {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    color: var(--error-color);
    text-align: center;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .container {
        padding: 1.5rem;
    }
}

/* Inventory Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.inventory-table th,
.inventory-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.inventory-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-color);
}

.inventory-table tr:hover {
    background-color: #f1f3f5;
}

.price-tag {
    font-weight: 600;
    color: var(--success-color);
}

.price-tag.original {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.nav-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination span {
    padding: 0.5rem 1rem;
    color: var(--text-light);
}

/* Split View Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    /* Input takes less space than results */
    gap: 2rem;
    align-items: stretch;
    /* Make columns equal height */
    transition: all 0.5s ease-in-out;
}

/* Single View (Input Only) */
.container.single-view .main-grid {
    display: block;
    max-width: 800px;
    margin: 0 auto;
}

.container.single-view .input-section {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.input-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    height: 100%;
    /* Ensure it fills the grid cell */
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    /* Ensure it fills the grid cell */
}

/* Currency Toggle Button */
.currency-btn {
    background-color: #f3f4f6;
    color: #ffffff;
    border: 1px solid #d1d5db;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    width: auto;
    /* Override global button width */
    margin-top: 0;
    /* Override global button margin */
}

.currency-btn:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
        /* Stack vertically on smaller screens */
    }
}

.chart-card {
    margin-top: 0;
    padding: 1.5rem;
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}