:root {
    --primary-color: #3b82f6;
    --text-color: #1f2937;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    margin-bottom: 3rem;
}

.back-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.back-link:hover {
    color: var(--primary-color);
}

h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: #111827;
}

.subtitle {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}

.section {
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: #374151;
}

/* Constants Grid */
.constants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.constant-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.constant-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.constant-card:active {
    background: #f0f9ff;
}

.constant-symbol {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    font-family: 'Times New Roman', serif;
}

.constant-name {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.constant-value {
    font-family: monospace;
    font-size: 1rem;
    color: var(--primary-color);
    word-break: break-all;
}

.unit {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-left: 0.25rem;
}

/* Converters */
.converter-box {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.kinematics-box {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.natural-units-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sub-converter h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 1rem;
}

.converter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.converter-row .input-group {
    flex: 1;
    min-width: 150px;
}

.arrow {
    color: #9ca3af;
    font-size: 1.2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.input-group label {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: monospace;
    width: 100%;
    box-sizing: border-box;
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    padding-right: 3.5rem;
}

.unit-label {
    position: absolute;
    right: 10px;
    color: #9ca3af;
    font-size: 0.85rem;
    pointer-events: none;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.operator {
    font-size: 1.5rem;
    color: #9ca3af;
    padding-bottom: 0.75rem;
    /* align */
    font-weight: bold;
}

.actions {
    display: flex;
    gap: 10px;
    flex-basis: 100%;
    margin-top: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn.primary {
    background: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background: #2563eb;
}

.btn.secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn.secondary:hover {
    background: #d1d5db;
}

.equals {
    font-size: 1.5rem;
    color: #9ca3af;
    margin: 0 1rem;
    padding-top: 1.5rem;
    /* align with input */
}

.note {
    width: 100%;
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 1rem;
    text-align: center;
    background: #f9fafb;
    padding: 0.5rem;
    border-radius: 4px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
}

footer {
    margin-top: 4rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}