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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo {
    height: 40px;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.home-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid #d6e4fb;
    border-radius: 999px;
    color: #1a73e8;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.home-link:hover {
    background-color: #eef5ff;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-button {
    padding: 10px 14px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 110px;
    white-space: nowrap;
}

.tab-button:hover {
    background-color: #e9ecef;
    border-color: #1a73e8;
}

.tab-button.active {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-content.active {
    display: block;
}

.input-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.info-text {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 25px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 3px solid #1a73e8;
    border-radius: 4px;
}

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

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #495057;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: white;
}

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

/* Remove number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Buttons */
.calculate-btn {
    width: 100%;
    padding: 14px 30px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 30px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

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

/* Output Section */
.output-section {
    border-top: 2px solid #e9ecef;
    padding-top: 25px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.output-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
}

.copy-btn {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 2px solid #1a73e8;
    border-radius: 6px;
    color: #1a73e8;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background-color: #1a73e8;
    color: white;
}

.copy-btn.copied {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.output-box {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #2c3e50;
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
}

/* Reference Section */
.reference-section {
    margin-top: 20px;
}

.reference-section h4 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.reference-box {
    background-color: #fff9e6;
    border: 2px solid #ffd966;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #2c3e50;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
    }

    .header-copy {
        align-items: center;
        text-align: center;
    }

    h1 {
        font-size: 1.5rem;
    }

    .logo {
        height: 35px;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

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

/* Scrollbar Styling */
.output-box::-webkit-scrollbar {
    width: 8px;
}

.output-box::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.output-box::-webkit-scrollbar-thumb {
    background: #1a73e8;
    border-radius: 4px;
}

.output-box::-webkit-scrollbar-thumb:hover {
    background: #1557b0;
}
