/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styles */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.header-content i {
    font-size: 48px;
}

header h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 18px;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Calculator Section */
.calculator-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.calculator-section h2 {
    font-size: 26px;
    color: #667eea;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Input Groups */
.input-group {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
}

.input-group:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.input-group h3 {
    font-size: 18px;
    color: #495057;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Form Rows and Fields */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 15px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-field label i {
    color: #667eea;
    width: 16px;
}

.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #6c757d;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
    margin-left: auto;
}

.form-field input,
.form-field select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
    background: white;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-field input[type="file"] {
    padding: 10px;
    cursor: pointer;
    border: 2px dashed #667eea;
    background: #f8f9ff;
}

.form-field input[type="file"]:hover {
    background: #e9ecff;
    border-color: #5568d3;
}

#gcodeInfo {
    margin-top: 10px;
    padding: 10px 12px;
    background: #e3f2fd;
    border-radius: 8px;
    font-size: 14px;
    border-left: 4px solid #2196F3;
}

/* Advanced Settings Toggle */
.advanced-toggle {
    margin: 20px 0;
    text-align: center;
}

.btn-toggle {
    padding: 12px 24px;
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-toggle:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-toggle i.fa-chevron-down {
    transition: transform 0.3s ease;
}

.btn-toggle.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.advanced-settings {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.results-section h2 {
    font-size: 26px;
    color: #667eea;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Prominent Retail Price Display */
.retail-price-display {
    margin-bottom: 30px;
    text-align: center;
}

.retail-price-card {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.retail-label {
    font-size: 20px;
    font-weight: 600;
    color: white;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.retail-value {
    font-size: 56px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Cost Details Toggle */
.cost-details-toggle {
    text-align: center;
    margin: 20px 0;
}

.btn-toggle-small {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #6c757d;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-toggle-small:hover {
    background: #6c757d;
    color: white;
}

.btn-toggle-small i.fa-chevron-down {
    transition: transform 0.3s ease;
}

.btn-toggle-small.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.cost-details-section {
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Total Cost Display */
.total-cost {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.cost-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.cost-item.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cost-item.suggested {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.cost-item.profit {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
}

.cost-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0.9;
}

.cost-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
}

/* Breakdown */
.breakdown {
    margin-bottom: 30px;
}

.breakdown h3 {
    font-size: 18px;
    color: #495057;
    margin-bottom: 20px;
    font-weight: 600;
}

.breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #495057;
}

.breakdown-label i {
    color: #667eea;
    width: 20px;
}

.breakdown-value {
    font-weight: 700;
    font-size: 18px;
    color: #667eea;
}

/* Chart Container */
.chart-container {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.chart-container h3 {
    font-size: 18px;
    color: #495057;
    margin-bottom: 20px;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 300px;
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card i {
    font-size: 32px;
    color: #667eea;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #495057;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 14px;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 32px;
    }

    .header-content i {
        font-size: 36px;
    }

    .subtitle {
        font-size: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .total-cost {
        grid-template-columns: 1fr;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .calculator-section,
    .results-section {
        padding: 20px;
    }

    .cost-value {
        font-size: 24px;
    }

    .button-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header {
        padding: 20px 10px;
    }

    header h1 {
        font-size: 24px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .calculator-section h2,
    .results-section h2 {
        font-size: 20px;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: slideIn 0.4s ease-out;
}
