/**
 * Variable Name Converter - Styles
 * Mobile-first responsive design with sticky results
 *
 * @version 1.0.0
 */

/* ========================================================================
   Results Sticky Container (Mobile-First Pattern A)
   ======================================================================== */

.results-sticky {
    background: var(--color-surface, #f8f9fa);
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    position: sticky;
    top: 70px; /* Below header */
    z-index: 10;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}

.results-sticky h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text, #212529);
}

/* Detected Format Display */
.detected-format-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--color-background, #ffffff);
    border-radius: 6px;
    border: 1px solid var(--color-border, #dee2e6);
}

.detected-format-display .label {
    font-weight: 500;
    color: var(--color-text-secondary, #6c757d);
}

.detected-format-display .value {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    padding: 4px 8px;
    border-radius: 4px;
}

.detected-format-display .value.success {
    color: var(--color-success, #28a745);
    background: var(--color-success-bg, #d4edda);
}

.detected-format-display .value.warning {
    color: var(--color-warning, #ffc107);
    background: var(--color-warning-bg, #fff3cd);
}

/* ========================================================================
   Results Grid (5 Naming Conventions)
   ======================================================================== */

.results-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

/* Mobile: Stack vertically */
@media (max-width: 767px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet and up: 2 columns */
@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns for better use of space */
@media (min-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Result Item */
.result-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item label {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text, #212529);
}

/* Result Output Group (Input + Button) */
.result-output-group {
    display: flex;
    gap: 8px;
}

.result-output {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--color-border, #ced4da);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    background: var(--color-background, #ffffff);
    color: var(--color-text, #212529);
}

.result-output:focus {
    outline: 2px solid var(--color-primary, #007bff);
    outline-offset: 2px;
}

/* Copy Button */
.btn-copy {
    flex-shrink: 0;
    min-width: 80px;
    padding: 10px 16px;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* Touch-friendly button size (44×44px minimum) */
@media (max-width: 767px) {
    .btn-copy {
        min-height: 44px;
        min-width: 70px;
        font-size: 0.8rem;
    }
}

.btn-copy:active {
    transform: scale(0.97);
}

/* Success state for copy feedback */
.btn-copy.btn-success {
    background-color: var(--color-success, #28a745);
    border-color: var(--color-success, #28a745);
    color: white;
}

/* ========================================================================
   Language Recommendation Display
   ======================================================================== */

.language-recommendation {
    margin-top: 16px;
}

.language-recommendation .alert {
    margin: 0;
}

.language-recommendation .alert-content strong {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

/* ========================================================================
   Input Section
   ======================================================================== */

.input-section {
    margin-bottom: 20px;
}

.input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text, #212529);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border, #ced4da);
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-secondary, #6c757d);
    opacity: 0.6;
}

/* Input Meta (Character Count) */
.input-meta {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--color-text-secondary, #6c757d);
    text-align: right;
}

/* ========================================================================
   Language Selector Section
   ======================================================================== */

.language-selector-section {
    margin-top: 20px;
}

.language-selector-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text, #212529);
}

.form-select {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--color-border, #ced4da);
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--color-background, #ffffff);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Mobile: Full width select */
@media (max-width: 767px) {
    .form-select {
        width: 100%;
    }
}

/* Desktop: Limit width */
@media (min-width: 768px) {
    .form-select {
        max-width: 400px;
    }
}

/* ========================================================================
   Error and Warning Display
   ======================================================================== */

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-danger {
    background-color: var(--color-danger-bg, #f8d7da);
    border: 1px solid var(--color-danger, #dc3545);
    color: var(--color-danger-text, #721c24);
}

.alert-warning {
    background-color: var(--color-warning-bg, #fff3cd);
    border: 1px solid var(--color-warning, #ffc107);
    color: var(--color-warning-text, #856404);
}

.alert-success {
    background-color: var(--color-success-bg, #d4edda);
    border: 1px solid var(--color-success, #28a745);
    color: var(--color-success-text, #155724);
}

.alert-info {
    background-color: var(--color-info-bg, #d1ecf1);
    border: 1px solid var(--color-info, #17a2b8);
    color: var(--color-info-text, #0c5460);
}

.alert-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ========================================================================
   Responsive Sticky Behavior
   ======================================================================== */

/* Mobile: Reduce sticky top offset for smaller screens */
@media (max-width: 767px) {
    .results-sticky {
        top: 56px; /* Smaller header on mobile */
        max-height: calc(100vh - 76px);
        padding: 16px;
    }
}

/* Tablet and up: Standard sticky behavior */
@media (min-width: 768px) {
    .results-sticky {
        top: 70px;
    }
}

/* Large desktop: Larger sticky area */
@media (min-width: 1280px) {
    .results-sticky {
        top: 70px;
        max-height: calc(100vh - 90px);
    }
}

/* ========================================================================
   Print Styles
   ======================================================================== */

@media print {
    .results-sticky {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .btn-copy {
        display: none;
    }
}
