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

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

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

header {
    background: white;
    padding: 30px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

form {
    background: white;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.form-grid {
    display: grid;
    gap: 30px;
}

.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.form-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.form-section h3 {
    color: #555;
    margin: 20px 0 15px 0;
    font-size: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* File Upload Styling */
.file-upload-wrapper {
    position: relative;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 60px;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 2px dashed #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-label:hover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.file-name {
    color: #666;
    font-size: 1rem;
}

.btn-browse {
    background: #667eea;
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: 500;
}

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

.thickness-multipliers .form-row {
    margin-bottom: 15px;
}

.form-group-small {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group-small label {
    color: #666;
    font-size: 0.9rem;
    min-width: 80px;
}

.form-group-small input {
    padding: 6px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    width: 80px;
    font-size: 0.9rem;
}

/* Submit Button */
.submit-section {
    background: transparent;
    padding: 0;
    border: none;
}

.btn-submit {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.btn-submit:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    background: white;
    padding: 30px;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.5s ease-out;
}

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

.results-section h2 {
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.result-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.result-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 15px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 5px;
}

.result-label {
    color: #666;
    font-size: 0.95rem;
}

.result-value {
    font-weight: 600;
    color: #333;
}

.result-total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

.total-label {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.total-amount {
    font-size: 2.5rem;
    font-weight: bold;
}

.download-section {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-download {
    flex: 1;
    padding: 12px 20px;
    background: #28a745;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-download:hover {
    background: #218838;
}

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

.btn-download.secondary:hover {
    background: #5a6268;
}

/* Loading Spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #f5c6cb;
    margin-bottom: 20px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #c3e6cb;
    margin-bottom: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: white;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .multipliers-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group-small {
        justify-content: space-between;
    }
    
    .download-section {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .form-section,
    footer,
    .btn-download,
    form {
        display: none;
    }
    
    .results-section {
        box-shadow: none;
        margin: 0;
    }
}