/* Modern Minimal UI */
* {
    font-family: 'Inter', system-ui, sans-serif;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    body {
        padding: 2.5rem;
    }
}

/* Header */
.page-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    margin: -1.5rem -1.5rem 2rem -1.5rem;
    padding: 2.5rem 1.5rem;
    border-radius: 0 0 2rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .page-header {
        margin: -2.5rem -2.5rem 2.5rem -2.5rem;
        padding: 3rem 2.5rem;
    }
}

.header-content {
    max-width: 72rem;
    margin: 0 auto;
    text-align: center;
}

.page-title {
    color: white;
    font-weight: 700;
    letter-spacing: -0.025em;
    font-size: 1.5rem;
    line-height: 2rem;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
}

.page-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Tab Navigation - Pill Style */
.tab-nav {
    max-width: 72rem;
    margin: 0 auto 2rem auto;
    display: flex;
    justify-content: center;
}

.tab-container {
    background: white;
    padding: 0.375rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: transparent;
    color: #64748b;
}

.tab-button:hover:not(.active) {
    background: #f1f5f9;
    color: #334155;
}

.tab-button.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

/* Copy All Sections area */
.copy-all-area {
    max-width: 72rem;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shortcut-hint {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.shortcut-hint kbd {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
    font-family: inherit;
}

/* Cards */
.card-container {
    max-width: 72rem;
    margin: 0 auto 1.25rem auto;
    background: white;
    padding: 1.75rem;
    border-radius: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.2s ease;
}

.card-container:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 1.25rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 2px;
}

.card-fields {
    margin-bottom: 1rem;
}

.card-actions {
    text-align: center;
}

/* Text areas */
.blueprint-text {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    padding: 1.25rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.75;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    white-space: pre-wrap;
    word-wrap: break-word;
    transition: all 0.2s ease;
}

.blueprint-text:hover {
    border-color: #cbd5e1;
}

/* Copy button */
.copy-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.copy-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

.copy-button:active {
    transform: scale(0.98);
}

.copy-button svg {
    width: 1rem;
    height: 1rem;
}

/* Secondary copy button (outlined) */
.copy-button.copy-secondary {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.copy-button.copy-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Feedback */
.copied-feedback {
    display: none;
    font-size: 0.8rem;
    margin-left: 0.75rem;
    color: #059669;
    font-weight: 500;
    background: #ecfdf5;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    transition: all 0.3s ease;
}

.copied-feedback.show {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    opacity: 1;
}

.copied-feedback.hide {
    opacity: 0;
}

/* Tab content */
.tab-content {
    transition: opacity 0.25s ease;
}

.tab-content.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .card-container {
        padding: 1.25rem;
        border-radius: 1rem;
        margin-bottom: 1rem;
    }

    .blueprint-text {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .tab-button {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }

    .copy-all-area {
        gap: 0.375rem;
    }

    .copy-all-area .copy-button {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

/* Editable Fields */
.fields-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.fields-container:hover {
    border-color: #cbd5e1;
}

.field-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    min-width: 140px;
    padding-top: 0.375rem;
    flex-shrink: 0;
    cursor: pointer;
}

.field-input {
    flex: 1;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: #1e293b;
    transition: all 0.2s ease;
    font-family: inherit;
}

.field-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.field-input::placeholder {
    color: #94a3b8;
}

.field-input-action {
    position: relative;
    flex: 1;
    display: flex;
}

.field-input-action .field-input {
    width: 100%;
    padding-right: 3.5rem;
}

.field-input-large {
    min-height: 60px;
    resize: vertical;
}

.field-template-button {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #dbeafe;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.96);
    color: #2563eb;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12);
    transition: all 0.2s ease;
}

.field-template-button:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

.field-template-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.field-template-button.is-active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.field-template-button svg {
    width: 1rem;
    height: 1rem;
}

/* Grid layout for vitals */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.fields-grid .field-row {
    border-bottom: none;
    background: white;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
}

.fields-grid .field-label {
    min-width: auto;
    font-size: 0.8rem;
}

.fields-grid .field-input {
    border: none;
    padding: 0.25rem 0;
    background: transparent;
}

.fields-grid .field-input:focus {
    box-shadow: none;
}

/* Section divider */
.fields-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 0;
}

.fields-section-title {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0 0.25rem 0;
}

.field-row + .fields-section-title {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Clear button */
.clear-button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.8rem;
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.clear-button:hover {
    background: #f1f5f9;
    color: #475569;
}

@media (max-width: 640px) {
    .field-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .field-label {
        min-width: auto;
        padding-top: 0;
    }

    .fields-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Footer */
.site-footer {
    max-width: 72rem;
    margin: 3rem auto 1rem auto;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

.footer-attribution {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    color: #b0bec5;
}

.footer-attribution a {
    color: #94a3b8;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
}

.footer-attribution a:hover {
    color: #64748b;
}
