/**
 * Bold Metrics Integration - Frontend Results Display Styles
 * Version: 0.2.0
 * Theme-friendly, responsive design
 */

/* ===================================
   Container and Layout
   =================================== */
.bm-result-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ===================================
   Section Styling
   =================================== */
.bm-section {
    margin-bottom: 40px;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ===================================
   Typography
   =================================== */
.bm-title {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.2;
}

.bm-section-title {
    font-size: 1.75em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* ===================================
   Hero Section
   =================================== */
.bm-hero {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
}

.bm-hero .bm-title {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bm-context {
    font-size: 1.1em;
    margin-top: 10px;
    opacity: 0.95;
}

.bm-context strong {
    font-weight: 600;
}

/* ===================================
   Size Recommendation Cards
   =================================== */
.bm-size-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bm-size-card {
    background: #f8f9fa;
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bm-size-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
}

.bm-size-label {
    font-size: 1.75em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.bm-fit-score {
    margin-top: 10px;
}

.bm-score-value {
    font-size: 2em;
    font-weight: 700;
    color: #4CAF50;
    display: block;
    line-height: 1;
}

.bm-score-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-top: 5px;
}

/* ===================================
   Measurement Grid
   =================================== */
.bm-measurement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bm-measurement-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: background 0.2s ease;
}

.bm-measurement-item:hover {
    background: #e9ecef;
}

.bm-measurement-label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 500;
}

.bm-measurement-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #2c3e50;
}

/* ===================================
   No Results Message
   =================================== */
.bm-no-results {
    text-align: center;
    padding: 30px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 1.1em;
}

/* ===================================
   Next Steps Section
   =================================== */
.bm-next-steps {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: none;
}

.bm-next-steps p {
    font-size: 1.1em;
    line-height: 1.6;
    color: #2c3e50;
    margin: 0;
}

/* ===================================
   Error Styling
   =================================== */
.bm-error {
    background: #ffe5e5;
    border-left: 4px solid #d32f2f;
    padding: 25px;
    border-radius: 8px;
    color: #b00020;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.15);
}

.bm-error h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
    color: #d32f2f;
}

.bm-error p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.bm-error p:last-child {
    margin-bottom: 0;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .bm-result-page {
        padding: 15px;
    }

    .bm-section {
        padding: 20px;
        margin-bottom: 30px;
    }

    .bm-title {
        font-size: 2em;
    }

    .bm-section-title {
        font-size: 1.5em;
    }

    .bm-size-cards {
        grid-template-columns: 1fr;
    }

    .bm-measurement-grid {
        grid-template-columns: 1fr;
    }

    .bm-size-label {
        font-size: 1.5em;
    }

    .bm-score-value {
        font-size: 1.75em;
    }

    .bm-measurement-value {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .bm-result-page {
        padding: 10px;
    }

    .bm-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .bm-title {
        font-size: 1.75em;
    }

    .bm-context {
        font-size: 1em;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .bm-result-page {
        max-width: 100%;
        padding: 0;
    }

    .bm-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .bm-hero {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bm-size-card {
        page-break-inside: avoid;
    }

    .bm-size-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ===================================
   Accessibility
   =================================== */
.bm-size-card:focus,
.bm-measurement-item:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bm-section {
        border: 2px solid #000;
    }

    .bm-size-card {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bm-size-card {
        transition: none;
    }

    .bm-size-card:hover {
        transform: none;
    }
}

/* ===================================
   Form Styles
   =================================== */
.bm-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.bm-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.bm-form-group {
    margin-bottom: 20px;
}

.bm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1em;
}

.bm-form-group .required {
    color: #d32f2f;
}

.bm-form-group input[type="number"],
.bm-form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.bm-form-group input[type="number"]:focus,
.bm-form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bm-radio-group {
    display: flex;
    gap: 20px;
}

.bm-radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.bm-radio-group input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.bm-conditional-fields {
    border-left: 4px solid #667eea;
    padding-left: 20px;
    margin-top: 10px;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 6px;
}

.bm-submit-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bm-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.bm-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.bm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bm-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 1em;
}

.bm-message.bm-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bm-message.bm-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.bm-results {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
}

.bm-results h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.75em;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.bm-results h4 {
    color: #555;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.bm-good-matches {
    margin-bottom: 25px;
}

.bm-size-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bm-size-list li {
    padding: 12px 15px;
    background: #f8f9fa;
    border-left: 4px solid #4CAF50;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 1.1em;
    transition: background 0.2s ease;
}

.bm-size-list li:hover {
    background: #e9ecef;
}

.bm-no-matches {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
}

.bm-predictions .bm-measurements {
    width: 100%;
    border-collapse: collapse;
}

.bm-predictions .bm-measurements td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.bm-predictions .bm-measurements tr:last-child td {
    border-bottom: none;
}

.bm-predictions .bm-measurements td:first-child {
    font-weight: 600;
    color: #555;
    width: 50%;
}

.bm-predictions .bm-measurements td:last-child {
    color: #333;
    text-align: right;
}

/* Form responsive styles */
@media (max-width: 768px) {
    .bm-form-container {
        padding: 10px;
    }

    .bm-form {
        padding: 20px;
    }

    .bm-results {
        padding: 20px;
    }

    .bm-radio-group {
        flex-direction: column;
        gap: 10px;
    }
}
