* {
    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;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.calculator-section {
    padding: 40px;
}

.input-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.input-card h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group small {
    display: block;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 5px;
}

.input-with-unit {
    display: flex;
    gap: 10px;
}

.input-with-unit input {
    flex: 1;
}

.input-with-unit select {
    width: 80px;
}

.height-inputs {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
}

#imperialHeight, #metricHeight {
    display: flex;
    gap: 10px;
    align-items: center;
}

#imperialHeight input, #metricHeight input {
    width: 80px;
}

input[type="number"],
select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

input[type="number"] {
    width: 100%;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

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

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

.results-section {
    margin-top: 40px;
}

.bmi-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.bmi-info h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.bmi-info #bmiValue {
    font-size: 2.2rem;
    font-weight: 700;
}

.bmi-info p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.chart-container {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.chart-container h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#weightChart {
    max-height: 400px;
    min-height: 400px;
}

.legend-info {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.legend-info p {
    margin-bottom: 5px;
    color: #555;
}

.table-container {
    margin-bottom: 30px;
}

.table-container h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.table-note {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.table-container > div {
    max-height: 600px;
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    position: relative;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody td {
    padding: 12px 15px;
}

.milestone-row {
    background-color: #f0f4ff;
    font-weight: 600;
}

.milestone-row:hover {
    background-color: #e8eeff;
}

.info-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.info-section p {
    margin-bottom: 15px;
    color: #333;
}

.info-section ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-section li {
    margin-bottom: 8px;
    color: #555;
}

footer {
    background: #2d3748;
    color: white;
    padding: 40px;
}

footer h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.disclaimer {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.disclaimer p {
    line-height: 1.8;
    opacity: 0.9;
}

.sources ul {
    list-style-position: inside;
    opacity: 0.9;
}

.sources li {
    margin-bottom: 8px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding: 20px 0;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn:hover {
    transform: translateY(-2px);
}

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

.btn-icon {
    font-size: 1.3rem;
}

.print-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.print-btn:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.email-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.modal-content p {
    color: #555;
    margin-bottom: 25px;
    line-height: 1.6;
}

.modal-input-group {
    margin-bottom: 25px;
}

.modal-input-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.modal-input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

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

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.cancel-btn {
    background: #f0f0f0;
    color: #333;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.email-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
}

.email-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.email-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .calculator-section {
        padding: 20px;
    }

    .input-card {
        padding: 20px;
    }

    .chart-container {
        padding: 20px;
    }

    #weightChart {
        max-height: 350px !important;
        min-height: 350px;
    }

    table {
        font-size: 0.85rem;
    }

    thead th,
    tbody td {
        padding: 8px;
    }

    .height-inputs {
        flex-direction: column;
        align-items: flex-start;
    }

    #imperialHeight {
        flex-wrap: wrap;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        padding: 25px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
    }

    .input-card,
    .calculate-btn,
    .action-buttons,
    .modal {
        display: none !important;
    }

    .chart-container,
    .info-section,
    .table-container {
        break-inside: avoid;
    }

    header {
        background: #667eea;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bmi-info {
        background: #667eea;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
