/* Settings Page Styles - Compatible with Original Structure */

/* Settings Container */
.settings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Settings Section */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E0E0E0;
}

.section-icon {
    font-size: 28px;
    color: var(--md-sys-color-primary);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

/* Settings Group */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Setting Item */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.setting-item-full {
    padding: 12px 0;
}

.setting-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.setting-description {
    font-size: 12px;
    color: #666;
}

.setting-select {
    padding: 8px 12px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

/* Weights Grid */
.weights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.weight-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #F8F9FA;
    border-radius: 8px;
}

.weight-item label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.weight-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weight-control-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #E0E0E0;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s;
}

.weight-control-btn:hover {
    background: var(--md-sys-color-primary);
    color: white;
    border-color: var(--md-sys-color-primary);
}

.weight-input {
    width: 60px;
    text-align: center;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    padding: 8px;
    font-size: 16px;
    font-weight: 600;
    background: white;
}

.weight-suffix {
    font-size: 14px;
    color: #666;
}

/* Validation Message */
.validation-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.validation-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.validation-message.error {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

/* Switch Toggle - RTL Compatible */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    right: 3px;  /* تغيير من left إلى right للـ RTL */
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.switch input:checked + .switch-slider {
    background-color: #2196F3;  /* لون أزرق ثابت بدلاً من المتغير */
}

.switch input:checked + .switch-slider:before {
    transform: translateX(-24px);  /* قيمة سالبة للـ RTL */
}

/* Button Group */
.button-group {
    display: flex;
    gap: 8px;
}

/* Settings Actions */
.settings-actions {
    margin-top: 32px;
    text-align: center;
    padding: 24px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-filled {
    background: var(--md-sys-color-primary);
    color: white;
}

.btn-filled:hover {
    box-shadow: 0 4px 12px rgba(47, 128, 237, 0.3);
    transform: translateY(-1px);
}

.btn-outlined {
    background: white;
    border: 1px solid #E0E0E0;
    color: #333;
}

.btn-outlined:hover {
    background: #F8F9FA;
    border-color: var(--md-sys-color-primary);
}

.btn-text {
    background: transparent;
    color: var(--md-sys-color-primary);
    padding: 8px 16px;
}

.btn-text:hover {
    background: rgba(47, 128, 237, 0.08);
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
    z-index: 1001;
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #E0E0E0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Period Times List */
.period-times-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.period-time-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #F8F9FA;
    border-radius: 8px;
}

.period-label-simple {
    font-weight: 600;
    color: #333;
    min-width: 100px;
}

.period-time-inputs {
    display: flex;
    gap: 16px;
}

.time-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-group label {
    font-size: 14px;
    color: #666;
}

.time-input {
    padding: 8px 12px;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 14px;
    width: 120px;
}

/* Responsive */
@media (max-width: 768px) {
    .settings-container {
        padding: 0 16px;
    }
    
    .settings-section {
        padding: 16px;
    }
    
    .weights-grid {
        grid-template-columns: 1fr;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
    
    .period-time-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .period-time-inputs {
        justify-content: space-between;
    }
}

/* Error States */
.text-error {
    color: var(--md-sys-color-error);
}

/* Material Icons Size Fix */
.material-icons-round {
    vertical-align: middle;
}