/**
 * Shared Secondary Page Styles
 *
 * Used by: post_review.html, buy_svt.html, balance pages, profile.html
 * Container, card, section, field layout, data rows, info sections,
 * and action bar shared across secondary pages.
 */

/* Page container — centered, max-width constrained */
.secondary-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Unified card */
.secondary-card {
    margin-bottom: 2rem;
    padding: var(--spacing-5, 1.5rem);
    border-radius: var(--radius-base, 6px);
    background: var(--color-white, #ffffff);
}

/* Sections with dividers */
.secondary-section {
    padding: var(--spacing-5, 1.5rem) 0;
    border-bottom: 1px solid var(--color-muted, #e9ecef);
}

.secondary-section:first-child {
    padding-top: 0;
}

.secondary-section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

/* Field layout */
.inline-field {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.inline-field:last-child {
    margin-bottom: 0;
}

.field-label {
    font-weight: 600;
    color: var(--color-text-primary);
    flex-shrink: 0;
    min-width: 165px;
}

.field-value {
    color: var(--color-text-primary);
    word-break: break-word;
}

/* Hash values — code snippet style */
.field-value.hash-value {
    font-family: var(--font-family-mono);
    font-size: 0.875rem;
    word-break: break-all;
    color: var(--color-text-primary);
    background-color: var(--color-gray-50, #f8f9fa);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm, 4px);
    border: 1px solid var(--color-gray-200, #dee2e6);
}

/* Help text */
.field-help-text {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-text-muted);
    margin-top: var(--spacing-2, 0.5rem);
    margin-bottom: var(--spacing-4, 1rem);
    line-height: 1.5;
    padding-left: calc(165px + 0.75rem); /* Align with field value */
}

.secondary-section .field-help-text:last-child {
    margin-bottom: 0;
}

/* Preview zone label */
.preview-zone-label {
    display: block;
    min-width: 0;
    margin-bottom: var(--spacing-2, 0.5rem);
}

/* Large title with black underline (post titles on review/buy pages) */
h2.review-post-title {
    margin-top: 0;
    border-bottom: 1px solid var(--color-gray-700, #495057);
}

/* Page actions bar — flex space-between with top border */
.page-actions-bar {
    display: flex;
    gap: var(--spacing-4, 1rem);
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-4, 1rem);
    border-top: 1px solid var(--color-muted);
    flex-wrap: wrap;
}

/* Data row pattern — label-value pairs in a horizontal row */
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-2) 0;
}

.data-row-label {
    color: var(--color-text-secondary);
}

.data-row-value {
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-mono);
}

.data-row-bordered {
    border-bottom: 1px solid var(--color-muted);
}

.data-row-bordered:last-of-type {
    border-bottom: none;
}

/* Info section — padded card with secondary background */
.secondary-info-section {
    padding: var(--spacing-4);
    margin-bottom: var(--spacing-4);
    background: var(--color-surface-secondary);
    border-radius: var(--radius-md);
}

.secondary-info-section h2 {
    margin-top: var(--spacing-2);
    margin-bottom: var(--spacing-3);
}

/* Responsive — tablet */
@media (max-width: 768px) {
    .secondary-container {
        padding: 1rem;
    }

    .secondary-card {
        padding: 1rem;
    }

    .page-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-4, 1rem);
    }
}

/* Responsive — mobile field stacking */
@media (max-width: 576px) {
    .inline-field {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-1, 0.25rem);
    }

    .field-label {
        min-width: 0;
    }

    .field-help-text {
        padding-left: 0;
    }

    .hash-value {
        max-width: 100%;
        white-space: normal;
        word-break: break-all;
    }

    .data-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-1);
    }
}
