/* ==========================================================
   MOBILE CONTROL VITALS PANEL (Optimized for ≤768px)
   ========================================================== */

.resus-settings-panel {
    background: linear-gradient(145deg, #1a1a1a, #1e1e1e);
    color: #e0e0e0;
    padding: 1.5rem;
    border-radius: 14px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    width: 92%;
    min-width: unset;
    max-width: none;
    margin: 1rem auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid #2a2a2a;
    position: relative;
    overflow: hidden;
}

.resus-settings-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #F90618, #2E3192);
}

.resus-settings-title {
    color: #ffffff;
    margin: 0 0 1.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    padding-bottom: 0.8rem;
}

.resus-settings-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #F90618, #2E3192);
    border-radius: 1px;
}

.resus-template-selector {
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.2rem;
    border-radius: 10px;
    border: 1px solid #333;
}

.resus-select-label {
    display: block;
    margin-bottom: 0.75rem;
    color: #e0e0e0;
    font-weight: 500;
    font-size: 1rem;
}

.resus-template-select {
    width: 100%;
    padding: 1rem;
    background: #252525;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
}

.resus-template-select:focus {
    outline: none;
    border-color: #2E3192;
    box-shadow: 0 0 0 2px rgba(46, 49, 146, 0.1);
    background: #2a2a2a;
}

.resus-template-select:hover {
    border-color: #4a4a4a;
}

.resus-current-values {
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.2rem;
    border-radius: 10px;
    border: 1px solid #333;
}

.resus-values-title {
    color: #ffffff;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    position: relative;
}

.resus-values-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 1px;
    background: linear-gradient(90deg, #F90618, #2E3192);
}

.resus-values-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.resus-table-header th {
    text-align: left;
    color: #b0b0b0;
    font-weight: 500;
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid #333;
    font-size: 0.8rem;
}

.resus-values-table td {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid #2a2a2a;
}

.resus-values-table tr:last-child td {
    border-bottom: none;
}

.resus-values-table td:nth-child(1) {
    color: #e0e0e0;
    font-weight: 400;
}

.resus-values-table td:nth-child(2) {
    color: #F90618;
    text-align: right;
    padding-right: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.resus-values-table td:nth-child(3) {
    color: #2E3192;
    text-align: right;
    font-weight: 500;
    font-size: 0.9rem;
}

.resus-controls {
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.2rem;
    border-radius: 10px;
    border: 1px solid #333;
}

.resus-slider-control {
    margin-bottom: 1.25rem;
    position: relative;
}

.resus-slider-control:last-child {
    margin-bottom: 0;
}

.resus-slider-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: #e0e0e0;
    font-weight: 500;
    font-size: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resus-slider-container {
    width: 100%;
    position: relative;
    margin-bottom: 0.5rem;
}

.resus-slider {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #333, #444);
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resus-slider:hover {
    background: linear-gradient(90deg, #3a3a3a, #4a4a4a);
}

.resus-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #F90618, #2E3192);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.resus-slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.resus-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #F90618, #2E3192);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.resus-slider::-moz-range-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.resus-slider-value {
    display: inline-block;
    min-width: 45px;
    text-align: right;
    color: #2E3192;
    font-weight: 600;
    font-size: 0.9rem;
    background: rgba(46, 49, 146, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(46, 49, 146, 0.2);
}

.resus-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.resus-apply-btn,
.resus-reset-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Remove complex hover effects for mobile */
.resus-apply-btn::before,
.resus-reset-btn::before {
    display: none;
}

.resus-apply-btn {
    background: linear-gradient(135deg, #2E3192, #25287a);
    color: white;
    box-shadow: 0 4px 12px rgba(46, 49, 146, 0.2);
}

.resus-apply-btn:active {
    background: linear-gradient(135deg, #25287a, #1e2166);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(46, 49, 146, 0.3);
}

.resus-reset-btn {
    background: linear-gradient(135deg, #F90618, #d40514);
    color: white;
    box-shadow: 0 4px 12px rgba(249, 6, 24, 0.2);
}

.resus-reset-btn:active {
    background: linear-gradient(135deg, #d40514, #b80412);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(249, 6, 24, 0.3);
}

.resus-apply-btn:active,
.resus-reset-btn:active {
    transform: translateY(0);
}

/* ==========================================================
   SMALL MOBILE OPTIMIZATIONS (≤480px)
   ========================================================== */
@media (max-width: 480px) {
    .resus-settings-panel {
        width: 90%;
        padding: 1.25rem;
        margin: 0.75rem auto;
        border-radius: 12px;
    }
    
    .resus-settings-title {
        font-size: 1.3rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.6rem;
    }
    
    .resus-template-selector,
    .resus-current-values,
    .resus-controls {
        padding: 1rem;
        margin: 1.25rem 0;
        border-radius: 8px;
    }
    
    .resus-select-label {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    
    .resus-template-select {
        padding: 0.9rem;
        font-size: 0.9rem;
    }
    
    .resus-values-title {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .resus-values-table {
        font-size: 0.85rem;
    }
    
    .resus-table-header th {
        padding: 0.5rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .resus-values-table td {
        padding: 0.5rem 0.3rem;
    }
    
    .resus-values-table td:nth-child(2),
    .resus-values-table td:nth-child(3) {
        font-size: 0.85rem;
    }
    
    .resus-slider-control {
        margin-bottom: 1rem;
    }
    
    .resus-slider-control label {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    
    .resus-slider-value {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }
    
    .resus-action-buttons {
        margin-top: 1.25rem;
        gap: 0.6rem;
    }
    
    .resus-apply-btn,
    .resus-reset-btn {
        padding: 0.9rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
}

/* ==========================================================
   VERY SMALL MOBILE OPTIMIZATIONS (≤360px)
   ========================================================== */
@media (max-width: 360px) {
    .resus-settings-panel {
        width: 88%;
        padding: 1rem;
    }
    
    .resus-settings-title {
        font-size: 1.2rem;
    }
    
    .resus-template-selector,
    .resus-current-values,
    .resus-controls {
        padding: 0.8rem;
    }
    
    .resus-values-table {
        font-size: 0.8rem;
    }
    
    .resus-table-header th {
        font-size: 0.7rem;
        padding: 0.4rem 0.2rem;
    }
    
    .resus-values-table td {
        padding: 0.4rem 0.2rem;
    }
    
    .resus-slider-control label {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .resus-slider-value {
        align-self: flex-end;
    }
}

/* ==========================================================
   ACCESSIBILITY & TOUCH OPTIMIZATIONS
   ========================================================== */

/* Focus states for touch devices */
.resus-template-select:focus,
.resus-slider:focus,
.resus-apply-btn:focus,
.resus-reset-btn:focus {
    outline: 2px solid #2E3192;
    outline-offset: 1px;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .resus-apply-btn:hover,
    .resus-reset-btn:hover,
    .resus-template-select:hover {
        transform: none;
    }
    
    .resus-apply-btn:active,
    .resus-reset-btn:active,
    .resus-template-select:active {
        transform: translateY(-1px);
    }
    
    .resus-slider::-webkit-slider-thumb:hover,
    .resus-slider::-moz-range-thumb:hover {
        transform: none;
    }
    
    .resus-slider::-webkit-slider-thumb:active,
    .resus-slider::-moz-range-thumb:active {
        transform: scale(1.15);
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .resus-template-select,
    .resus-slider,
    .resus-apply-btn,
    .resus-reset-btn,
    .resus-slider::-webkit-slider-thumb,
    .resus-slider::-moz-range-thumb {
        transition: none !important;
    }
    
    .resus-apply-btn:active,
    .resus-reset-btn:active {
        transform: none !important;
    }
}

/* Loading states */
.resus-apply-btn:disabled,
.resus-reset-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Success and error message styles */
.resus-message {
    margin: 1rem 0;
    padding: 0.8rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.resus-message.success {
    background: rgba(46, 49, 146, 0.1);
    border: 1px solid rgba(46, 49, 146, 0.3);
    color: #e0e0e0;
}

.resus-message.error {
    background: rgba(249, 6, 24, 0.1);
    border: 1px solid rgba(249, 6, 24, 0.3);
    color: #e0e0e0;
}

/* Landscape orientation support */
@media (max-width: 768px) and (orientation: landscape) {
    .resus-settings-panel {
        margin: 0.5rem auto;
        padding: 1rem;
    }
    
    .resus-action-buttons {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .resus-apply-btn,
    .resus-reset-btn {
        padding: 0.8rem 1rem;
        min-height: 42px;
    }
    
    .resus-values-table {
        font-size: 0.8rem;
    }
}

/* Ensure proper touch targets for all interactive elements */
.resus-template-select,
.resus-slider,
.resus-apply-btn,
.resus-reset-btn {
    min-height: 44px;
}

/* Improve slider touch target */
.resus-slider-container {
    padding: 8px 0;
}

/* Optimize table for mobile readability */
@media (max-width: 480px) {
    .resus-values-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .resus-values-table table {
        min-width: 280px;
    }
}