* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #7c3aed 0%, #3730a3 50%, #1e3a8a 100%);
    min-height: 100vh;
}

/* Brand Header */
.brand-header {
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brand-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.brand-logo .logo-img {
    height: 60px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.nav-link.active {
    background: #7c3aed;
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 20px;
}

/* Updated Hero Section */
.calculator-hero {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #dc2626 100%);
    color: white;
    text-align: center;
    padding: 60px 40px;
    margin-bottom: 50px;
    border-radius: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 60px rgba(249, 115, 22, 0.4),
        0 0 100px rgba(251, 191, 36, 0.2),
        0 20px 40px rgba(0,0,0,0.15);
}

.calculator-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.1) 0%, transparent 70%);
    animation: glow 6s ease-in-out infinite alternate;
}

@keyframes glow {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

.calculator-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="20" opacity="0.1">🕯️</text></svg>') repeat;
    background-size: 80px 80px;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.calculator-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    position: relative;
}

.calculator-hero p {
    font-size: 1.3rem;
    margin-bottom: 35px;
    opacity: 0.95;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.2);
}

.features {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.feature {
    background: rgba(255,255,255,0.25);
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.35);
}

@media (max-width: 768px) {
    .brand-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .main-nav {
        gap: 20px;
    }
    
    .calculator-hero {
        padding: 40px 20px;
        margin-bottom: 30px;
    }
    
    .calculator-hero h1 {
        font-size: 2.2rem;
    }
    
    .calculator-hero p {
        font-size: 1.1rem;
    }
    
    .features {
        gap: 15px;
    }
    
    .feature {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Calculator Layout */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

@media (max-width: 768px) {
    .brand-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .main-nav {
        gap: 20px;
    }
    
    .calculator-hero {
        padding: 40px 20px;
        margin-bottom: 30px;
    }
    
    .calculator-hero h1 {
        font-size: 2.2rem;
    }
    
    .calculator-hero p {
        font-size: 1.1rem;
    }
    
    .features {
        gap: 15px;
    }
    
    .feature {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Card Styling */
.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 40px;
}

.card h2 {
    color: #c2410c;
    margin-bottom: 25px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #d97706;
}

/* Unit Toggle Component */
.input-with-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-with-toggle input {
    flex: 1;
}

.unit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 25px;
    border: 2px solid #e5e7eb;
}

.unit-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.3s;
    min-width: 35px;
    text-align: center;
}

.unit-label.active {
    color: #d97706;
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 25px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch.active {
    background: #d97706;
}

.toggle-slider {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

/* Wax Info */
.wax-info {
    margin-top: 8px;
}

.wax-info small {
    color: #6b7280;
    font-size: 0.85rem;
    display: block;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #d97706;
}

/* Slider */
.slider-container {
    margin: 20px 0;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d97706;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d97706;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 5px;
}

/* Results Section */
.results {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #059669;
}

/* Recipe Actions */
.recipe-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(217, 119, 6, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

/* Warning */
.warning {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    color: #dc2626;
}

.warning strong {
    display: block;
    margin-bottom: 5px;
}

/* Templates */
.templates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.template {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.template:hover {
    border-color: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.template h3 {
    color: #d97706;
    margin-bottom: 10px;
}

/* Badge */
.badge {
    display: inline-block;
    background: #d97706;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Cost Breakdown */
.cost-breakdown {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.savings-highlight {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.savings-amount {
    font-size: 2rem;
    font-weight: 800;
    color: #059669;
    margin-bottom: 10px;
}

/* FAQ Section */
.faq {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-top: 50px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.faq h2 {
    color: #c2410c;
    margin-bottom: 35px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
}

/* Tips Section Styles */
.tips-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.tips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.toggle-tips-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    min-width: 140px;
}

.toggle-tips-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.toggle-tips-btn.active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.toggle-tips-btn.active:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.tips-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tip-category {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tip-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.tip-category h3 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.safety-category {
    border-left: 4px solid #dc2626;
}

.safety-category h3 {
    color: #dc2626;
}

.tip-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tip-content li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    color: #4b5563;
    line-height: 1.5;
}

.tip-content li::before {
    content: "•";
    color: #c2410c;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.tip-content strong {
    color: #1f2937;
    font-weight: 600;
}

.pro-tip {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 15px;
    padding: 25px;
    border-left: 4px solid #10b981;
    margin-top: 25px;
}

.pro-tip h4 {
    color: #059669;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.pro-tip p {
    color: #047857;
    margin: 0;
    line-height: 1.6;
}

.faq-item {
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.faq-answer {
    color: #6b7280;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.close {
    color: white;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 1;
}

.modal-actions {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Recipe Card Styles */
.recipe-card {
    padding: 30px;
    line-height: 1.8;
}

.recipe-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #d97706;
}

.recipe-title {
    font-size: 1.8rem;
    color: #d97706;
    margin-bottom: 10px;
    font-weight: 700;
}

.recipe-date {
    color: #6b7280;
    font-size: 0.9rem;
}

.recipe-section {
    margin-bottom: 25px;
}

.recipe-section h3 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.recipe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.recipe-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #d1d5db;
}

.recipe-value {
    font-weight: 600;
    color: #059669;
}

.recipe-notes {
    background: #fef2f2;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
    margin-top: 15px;
}

.recipe-notes h4 {
    color: #dc2626;
    margin-bottom: 8px;
}

.safety-tips {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    margin-top: 15px;
}

.safety-tips h4 {
    color: #0ea5e9;
    margin-bottom: 8px;
}

.safety-tips ul {
    margin-left: 20px;
}

.safety-tips li {
    margin-bottom: 5px;
    color: #374151;
}

/* Print Styles */
@media print {
    /* Hide everything except the modal when printing */
    body > *:not(#printModal) {
        display: none !important;
    }
    
    /* Reset modal for print */
    #printModal {
        position: static !important;
        display: block !important;
        background: none !important;
        backdrop-filter: none !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .modal-content {
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        max-width: none !important;
        width: 100% !important;
        max-height: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }
    
    .modal-header {
        background: white !important;
        color: #c2410c !important;
        border-radius: 0 !important;
        padding: 20px 0 !important;
        border-bottom: 2px solid #c2410c !important;
    }
    
    .modal-actions {
        display: none !important;
    }
    
    .recipe-card {
        padding: 0 !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
    }
    
    /* Ensure content fits well on paper */
    .recipe-section {
        page-break-inside: avoid;
        margin-bottom: 20px !important;
    }
    
    .recipe-grid {
        gap: 10px !important;
    }
    
    .recipe-notes,
    .safety-tips {
        page-break-inside: avoid;
        margin-top: 15px !important;
        padding: 10px !important;
    }
    
    /* Remove any potential height constraints */
    * {
        max-height: none !important;
        overflow: visible !important;
    }
}