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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    color: #2d3748;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Progress Bar */
.progress-container {
    background: white;
    padding: 20px 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    z-index: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #a0aec0;
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: #3182ce;
    border-color: #3182ce;
    color: white;
}

.step-label {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #718096;
    text-align: center;
}

.progress-step.active .step-label {
    color: #3182ce;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.form-step {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.step-header {
    margin-bottom: 24px;
}

.step-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.step-description {
    color: #718096;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Patient Info */
.patient-info {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #ebf8ff;
    border-radius: 8px;
    border: 2px solid #bee3f8;
    flex-wrap: wrap;
}

.info-field {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-field label {
    font-weight: 600;
    color: #2c5282;
    font-size: 0.875rem;
}

.info-input {
    padding: 12px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.info-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table thead {
    background: #f7fafc;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}

.day-column {
    text-align: left;
    padding-left: 16px;
    width: 80px;
    position: sticky;
    left: 0;
    background: #f7fafc;
    z-index: 11;
}

.time-column {
    min-width: 120px;
}

.time-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.time-icon {
    font-size: 1.2rem;
}

.data-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

.data-table tbody tr:hover {
    background: #f7fafc;
}

.data-table td {
    padding: 12px 8px;
    text-align: center;
}

.data-table td.day-cell {
    text-align: left;
    padding-left: 16px;
    font-weight: 600;
    color: #2d3748;
    position: sticky;
    left: 0;
    background: white;
}

.data-table tbody tr:hover td.day-cell {
    background: #f7fafc;
}

.data-input {
    width: 100%;
    max-width: 100px;
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    text-align: center;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.data-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.data-input:invalid {
    border-color: #fc8181;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #3182ce;
    color: white;
}

.btn-primary:hover {
    background: #2c5282;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.btn-clear {
    background: white;
    color: #718096;
    border: 1px solid #e2e8f0;
}

.btn-clear:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

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

/* Results Page */
.patient-summary {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #ebf8ff;
    border-radius: 8px;
    border: 2px solid #bee3f8;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.patient-summary .summary-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.patient-summary .summary-label {
    font-weight: 600;
    color: #2c5282;
}

.patient-summary .summary-value {
    font-weight: 700;
    color: #3182ce;
    font-size: 1.125rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.result-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.result-card h3 {
    color: #2d3748;
    font-size: 1.125rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row.highlighted {
    background: #ebf8ff;
    padding: 16px;
    border-radius: 6px;
    border: none;
    margin: 8px 0;
}

.stat-label {
    color: #718096;
    font-size: 0.875rem;
}

.stat-value {
    color: #2d3748;
    font-weight: 600;
    font-size: 1rem;
}

.stat-row.highlighted .stat-label {
    color: #2c5282;
    font-size: 1rem;
    font-weight: 600;
}

.stat-row.highlighted .stat-value {
    color: #3182ce;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Final Results Container */
.final-results-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 32px;
    margin-bottom: 32px;
}

.final-result-card {
    background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
    border: 2px solid #bee3f8;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.final-result-card h3 {
    color: #2c5282;
    font-size: 1rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.final-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3182ce;
    margin-bottom: 8px;
    line-height: 1.2;
    white-space: nowrap;
}

.final-value .unit {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2c5282;
}

.final-description {
    font-size: 0.75rem;
    color: #718096;
}

/* Percentage Results Container */
.percentage-results-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.percentage-result-card {
    background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%);
    border: 2px solid #f9d99b;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.percentage-result-card h3 {
    color: #7d5a29;
    font-size: 1rem;
    margin-bottom: 16px;
    font-weight: 700;
}

.percentage-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #d68910;
    margin-bottom: 8px;
    line-height: 1.2;
    white-space: nowrap;
}

.percentage-value .unit {
    font-size: 0.875rem;
    font-weight: 600;
    color: #7d5a29;
}

.percentage-description {
    font-size: 0.75rem;
    color: #7d5a29;
}

.overall-summary {
    background: linear-gradient(135deg, #ebf8ff 0%, #e6fffa 100%);
    border: 2px solid #bee3f8;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.overall-summary h3 {
    color: #2c5282;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
}

.regular-result {
    text-align: center;
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.regular-value {
    font-size: 3rem;
    font-weight: 700;
    color: #3182ce;
    margin-bottom: 12px;
}

.regular-description {
    font-size: 0.875rem;
    color: #718096;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.summary-item {
    text-align: center;
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #3182ce;
    margin-bottom: 8px;
}

.summary-label {
    font-size: 0.75rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.app-footer {
    background: white;
    padding: 16px;
    text-align: center;
    color: #718096;
    font-size: 0.875rem;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

/* Tablet Optimization */
@media (max-width: 1024px) {
    .main-content {
        padding: 16px;
    }

    .form-step {
        padding: 20px;
    }

    .time-column {
        min-width: 100px;
    }

    .data-input {
        max-width: 80px;
        font-size: 0.8rem;
    }

    /* Final Results - Tablet */
    .final-results-container {
        gap: 12px;
        margin-bottom: 28px;
    }

    .final-value {
        font-size: 2.25rem;
    }

    .final-value .unit {
        font-size: 0.8rem;
    }

    /* Percentage Results - Tablet */
    .percentage-results-container {
        gap: 12px;
        margin-bottom: 28px;
    }

    .percentage-value {
        font-size: 2.25rem;
    }

    .percentage-value .unit {
        font-size: 0.8rem;
    }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .progress-container {
        padding: 15px 5px;
    }

    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .step-label {
        font-size: 0.65rem;
    }

    .main-content {
        padding: 12px;
    }

    .form-step {
        padding: 16px;
        border-radius: 8px;
    }

    .step-header h2 {
        font-size: 1.25rem;
    }

    .step-description {
        font-size: 0.8rem;
    }

    .data-table th {
        padding: 10px 6px;
        font-size: 0.75rem;
    }

    .day-column {
        width: 60px;
        padding-left: 12px;
    }

    .time-column {
        min-width: 90px;
    }

    .time-icon {
        font-size: 1rem;
    }

    .time-header span:last-child {
        font-size: 0.7rem;
    }

    .data-table td {
        padding: 10px 4px;
    }

    .data-table td.day-cell {
        padding-left: 12px;
        font-size: 0.875rem;
    }

    .data-input {
        max-width: 70px;
        padding: 6px;
        font-size: 0.75rem;
    }

    .form-actions {
        justify-content: stretch;
    }

    .btn {
        flex: 1;
        justify-content: center;
        padding: 10px 16px;
    }

    /* Patient Info - Mobile */
    .patient-info {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .info-field {
        min-width: 100%;
    }

    /* Results - Mobile */
    .results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-card {
        padding: 16px;
    }

    .result-card h3 {
        font-size: 1rem;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .summary-value {
        font-size: 1.5rem;
    }

    .overall-summary {
        padding: 16px;
    }

    .overall-summary h3 {
        font-size: 1.25rem;
    }

    .regular-result {
        padding: 24px;
    }

    .regular-value {
        font-size: 2.5rem;
    }

    .regular-description {
        font-size: 0.8rem;
    }

    /* Final Results - Mobile */
    .final-results-container {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 20px;
        margin-bottom: 24px;
    }

    .final-result-card {
        padding: 20px;
    }

    .final-result-card h3 {
        font-size: 0.9rem;
    }

    .final-value {
        font-size: 2rem;
    }

    .final-value .unit {
        font-size: 0.75rem;
    }

    /* Percentage Results - Mobile */
    .percentage-results-container {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .percentage-result-card {
        padding: 20px;
    }

    .percentage-result-card h3 {
        font-size: 0.9rem;
    }

    .percentage-value {
        font-size: 2rem;
    }

    .percentage-value .unit {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .progress-bar::before {
        display: none;
    }

    .step-label {
        display: none;
    }

    .time-column {
        min-width: 75px;
    }

    .time-header span:last-child {
        font-size: 0.65rem;
    }

    .data-input {
        max-width: 60px;
        padding: 5px 2px;
    }
}

