/* ========== VARIABLES ========== */
:root {
    /* رنگ‌های اصلی */
    --rsg-color-primary: #0E1C3C;
    --rsg-color-secondary: #FFC107;
    --rsg-color-accent: #1a2d5f;
    
    /* رنگ‌های تکمیلی */
    --rsg-color-background: #ffffff;
    --rsg-color-surface: #fafafa;
    --rsg-color-surface-dark: #f5f7ff;
    
    /* رنگ‌های متن */
    --rsg-color-text-primary: #0E1C3C;
    --rsg-color-text-secondary: #666666;
    --rsg-color-text-light: #888888;
    --rsg-color-text-on-dark: #ffffff;
    
    /* رنگ‌های وضعیت */
    --rsg-color-success: #28a745;
    --rsg-color-warning: #ffc107;
    --rsg-color-error: #dc3545;
    --rsg-color-info: #17a2b8;
    
    /* رنگ‌های تعاملی */
    --rsg-color-hover: rgba(14, 28, 60, 0.05);
    --rsg-color-active: rgba(255, 193, 7, 0.1);
    --rsg-color-border: rgba(14, 28, 60, 0.1);
    --rsg-color-border-light: rgba(14, 28, 60, 0.05);
    
    /* سایه‌ها */
    --rsg-shadow-sm: 0 2px 8px rgba(14, 28, 60, 0.05);
    --rsg-shadow-md: 0 8px 20px rgba(14, 28, 60, 0.08);
    --rsg-shadow-lg: 0 15px 30px rgba(14, 28, 60, 0.12);
    --rsg-shadow-xl: 0 25px 50px -12px rgba(14, 28, 60, 0.15);
    
    /* شعاع‌ها */
    --rsg-radius-sm: 8px;
    --rsg-radius-md: 16px;
    --rsg-radius-lg: 24px;
    --rsg-radius-xl: 32px;
    --rsg-radius-full: 9999px;
    
    /* فونت */
    --rsg-font-family: Vazirmatn, 'Yekan Bakh', sans-serif;
}

/* ========== BASE STYLES ========== */
.ramadani-size-guide-container {
    font-family: var(--rsg-font-family);
    direction: rtl;
    text-align: right;
}

/* ========== HEADER ========== */
.rsg-header {
    padding: 3rem 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 0.03) 0%, 
        rgba(14, 28, 60, 0.03) 100%);
    border-bottom: 1px solid var(--rsg-color-border-light);
}

.rsg-title {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--rsg-color-primary) 0%, var(--rsg-color-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.rsg-subtitle {
    font-size: 1.2rem;
    color: var(--rsg-color-text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========== PROGRESS INDICATOR ========== */
.rsg-progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--rsg-color-surface);
    border-bottom: 1px solid var(--rsg-color-border-light);
}

.rsg-progress-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.rsg-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--rsg-color-surface);
    border: 2px solid var(--rsg-color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--rsg-color-text-light);
    transition: all 0.3s ease;
    z-index: 2;
}

.rsg-step-text {
    font-size: 0.875rem;
    color: var(--rsg-color-text-light);
    font-weight: 500;
    transition: all 0.3s ease;
}

.rsg-progress-step.active .rsg-step-number {
    background: linear-gradient(135deg, var(--rsg-color-secondary) 0%, #ffab00 100%);
    border-color: var(--rsg-color-secondary);
    color: var(--rsg-color-primary);
    box-shadow: var(--rsg-shadow-sm);
}

.rsg-progress-step.active .rsg-step-text {
    color: var(--rsg-color-primary);
    font-weight: 700;
}

.rsg-progress-step.completed .rsg-step-number {
    background: var(--rsg-color-primary);
    border-color: var(--rsg-color-primary);
    color: var(--rsg-color-text-on-dark);
}

.rsg-progress-step.completed .rsg-step-text {
    color: var(--rsg-color-primary);
}

.rsg-progress-connector {
    flex: 1;
    height: 2px;
    background: var(--rsg-color-border);
    max-width: 60px;
    position: relative;
    overflow: hidden;
}

.rsg-progress-connector.active {
    background: linear-gradient(90deg, var(--rsg-color-secondary) 0%, var(--rsg-color-primary) 100%);
}

/* ========== CONTENT WRAPPER ========== */
.rsg-content-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    min-height: 700px;
}

/* ========== SIZING SIDE ========== */
.rsg-sizing-side {
    padding: 3rem 2rem;
    background: linear-gradient(145deg, 
        var(--rsg-color-background) 0%, 
        var(--rsg-color-surface) 100%);
    border-left: 1px solid var(--rsg-color-border-light);
}

/* Gender Selector */
.rsg-gender-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    background: var(--rsg-color-surface);
    padding: 0.5rem;
    border-radius: var(--rsg-radius-lg);
    width: fit-content;
}

.rsg-gender-btn {
    padding: 1rem 2rem;
    border-radius: var(--rsg-radius-md);
    background: transparent;
    border: none;
    font-family: var(--rsg-font-family);
    font-size: 1rem;
    font-weight: 500;
    color: var(--rsg-color-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rsg-gender-btn:hover {
    background: var(--rsg-color-hover);
}

.rsg-gender-btn.active {
    background: var(--rsg-color-background);
    color: var(--rsg-color-primary);
    font-weight: 700;
    box-shadow: var(--rsg-shadow-md);
}

.rsg-gender-btn i {
    font-size: 1.125rem;
}

/* Size Tables */
.rsg-tables-container {
    margin-bottom: 3rem;
}

.rsg-size-table {
    display: none;
    animation: fadeIn 0.5s ease;
}

.rsg-size-table.active {
    display: block;
}

.rsg-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 193, 7, 0.2);
}

.rsg-table-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rsg-color-primary);
}

.rsg-size-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--rsg-color-text-light);
    cursor: help;
    transition: color 0.15s ease;
}

.rsg-size-help:hover {
    color: var(--rsg-color-primary);
}

.rsg-size-table-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--rsg-color-background);
    border-radius: var(--rsg-radius-lg);
    overflow: hidden;
    box-shadow: var(--rsg-shadow-md);
}

.rsg-size-table-grid thead {
    background: linear-gradient(135deg, var(--rsg-color-primary) 0%, var(--rsg-color-accent) 100%);
}

.rsg-size-table-grid th {
    padding: 1rem;
    text-align: center;
    color: var(--rsg-color-text-on-dark);
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rsg-size-table-grid th:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.rsg-size-table-grid tbody tr {
    transition: all 0.15s ease;
}

.rsg-size-table-grid tbody tr:hover {
    background: var(--rsg-color-hover);
}

.rsg-size-table-grid td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--rsg-color-border-light);
    font-size: 1rem;
}

.rsg-size-table-grid td:first-child {
    font-weight: 700;
    color: var(--rsg-color-primary);
    border-right: 1px solid var(--rsg-color-border-light);
}

.rsg-size-table-grid tr:last-child td {
    border-bottom: none;
}

.rsg-recommended-size {
    background: rgba(255, 193, 7, 0.05) !important;
    position: relative;
}

.rsg-recommended-size::after {
    content: 'پیشنهادی';
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, var(--rsg-color-secondary) 0%, #ffab00 100%);
    color: var(--rsg-color-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--rsg-radius-full);
}

/* Measurement Guide */
.rsg-measurement-guide {
    background: linear-gradient(135deg, 
        rgba(14, 28, 60, 0.03) 0%, 
        rgba(255, 193, 7, 0.03) 100%);
    border-radius: var(--rsg-radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255, 193, 7, 0.15);
}

.rsg-measurement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.rsg-measurement-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rsg-color-primary);
}

.rsg-measurement-title i {
    color: var(--rsg-color-secondary);
}

.rsg-measurement-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.rsg-measurement-step {
    background: var(--rsg-color-background);
    border-radius: var(--rsg-radius-md);
    padding: 1.5rem;
    box-shadow: var(--rsg-shadow-sm);
    border: 1px solid var(--rsg-color-border-light);
    transition: all 0.3s ease;
}

.rsg-measurement-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--rsg-shadow-md);
}

.rsg-step-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 0.1) 0%, 
        rgba(14, 28, 60, 0.1) 100%);
    border-radius: var(--rsg-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--rsg-color-primary);
    font-size: 1.25rem;
}

.rsg-step-name {
    font-weight: 700;
    color: var(--rsg-color-primary);
    margin-bottom: 0.5rem;
}

.rsg-step-desc {
    font-size: 0.875rem;
    color: var(--rsg-color-text-secondary);
    line-height: 1.6;
}

/* ========== CALCULATOR SIDE ========== */
.rsg-calculator-side {
    padding: 3rem 2rem;
    background: linear-gradient(145deg, 
        var(--rsg-color-surface-dark) 0%, 
        var(--rsg-color-background) 100%);
    display: flex;
    flex-direction: column;
}

/* Calculator */
.rsg-size-calculator {
    background: var(--rsg-color-background);
    border-radius: var(--rsg-radius-lg);
    padding: 2rem;
    box-shadow: var(--rsg-shadow-md);
    border: 1px solid var(--rsg-color-border-light);
    margin-bottom: 2rem;
}

.rsg-calculator-header {
    margin-bottom: 1.5rem;
}

.rsg-calculator-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rsg-color-primary);
    margin-bottom: 0.5rem;
}

.rsg-calculator-title i {
    color: var(--rsg-color-secondary);
}

.rsg-calculator-subtitle {
    color: var(--rsg-color-text-secondary);
    font-size: 1rem;
}

/* Input Sections */
.rsg-input-section {
    margin-bottom: 1.5rem;
}

.rsg-section-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    color: var(--rsg-color-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.rsg-section-label i {
    color: var(--rsg-color-secondary);
}

.rsg-input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.rsg-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rsg-input-label {
    font-size: 0.875rem;
    color: var(--rsg-color-text-secondary);
    font-weight: 500;
}

.rsg-input-wrapper {
    position: relative;
}

.rsg-input-wrapper input {
    width: 100%;
    padding: 1rem;
    padding-right: 1.5rem;
    border: 2px solid var(--rsg-color-border);
    border-radius: var(--rsg-radius-md);
    font-family: var(--rsg-font-family);
    font-size: 1rem;
    color: var(--rsg-color-primary);
    background: var(--rsg-color-background);
    transition: all 0.15s ease;
}

.rsg-input-wrapper input:focus {
    outline: none;
    border-color: var(--rsg-color-secondary);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.rsg-input-wrapper input:disabled {
    background: var(--rsg-color-surface);
    color: var(--rsg-color-text-light);
    cursor: not-allowed;
}

.rsg-input-unit {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rsg-color-text-light);
    font-size: 0.875rem;
}

/* Measurement Buttons */
.rsg-measurement-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

.rsg-measure-btn {
    padding: 1rem;
    border: 2px solid var(--rsg-color-border);
    border-radius: var(--rsg-radius-md);
    background: var(--rsg-color-background);
    color: var(--rsg-color-primary);
    font-family: var(--rsg-font-family);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.rsg-measure-btn:hover {
    background: var(--rsg-color-hover);
    border-color: var(--rsg-color-secondary);
}

.rsg-measure-btn.active {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--rsg-color-secondary);
    color: var(--rsg-color-primary);
    font-weight: 700;
}

/* Calculate Button */
.rsg-calculate-btn {
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--rsg-color-primary) 0%, var(--rsg-color-accent) 100%);
    color: var(--rsg-color-text-on-dark);
    border: none;
    border-radius: var(--rsg-radius-md);
    font-family: var(--rsg-font-family);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.rsg-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--rsg-shadow-lg);
}

.rsg-calculate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result Container */
.rsg-result-container {
    background: linear-gradient(135deg, 
        rgba(14, 28, 60, 0.05) 0%, 
        rgba(255, 193, 7, 0.05) 100%);
    border-radius: var(--rsg-radius-lg);
    padding: 2rem;
    border: 2px solid var(--rsg-color-secondary);
    margin-top: 1.5rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.rsg-result-container.show {
    display: block;
}

.rsg-result-header {
    text-align: center;
    margin-bottom: 1rem;
}

.rsg-result-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--rsg-color-secondary) 0%, #ffab00 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--rsg-color-primary);
    font-size: 1.5rem;
}

.rsg-result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rsg-color-primary);
    margin-bottom: 0.5rem;
}

.rsg-result-value {
    font-size: 3.5rem;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, var(--rsg-color-primary) 0%, var(--rsg-color-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 1rem 0;
}

.rsg-result-details {
    background: var(--rsg-color-background);
    border-radius: var(--rsg-radius-md);
    padding: 1.5rem;
    margin-top: 1rem;
}

.rsg-result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rsg-color-border-light);
}

.rsg-result-row:last-child {
    border-bottom: none;
}

.rsg-result-label {
    color: var(--rsg-color-text-secondary);
}

.rsg-result-data {
    font-weight: 700;
    color: var(--rsg-color-primary);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1200px) {
    .rsg-content-wrapper {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .rsg-sizing-side {
        border-left: none;
        border-bottom: 1px solid var(--rsg-color-border-light);
    }
}

@media (max-width: 992px) {
    .rsg-header {
        padding: 2rem 1.5rem 1rem;
    }
    
    .rsg-title {
        font-size: 2.2rem;
    }
    
    .rsg-sizing-side, .rsg-calculator-side {
        padding: 2rem 1.5rem;
    }
    
    .rsg-measurement-steps {
        grid-template-columns: 1fr;
    }
    
    .rsg-input-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .rsg-title {
        font-size: 1.8rem;
    }
    
    .rsg-subtitle {
        font-size: 1rem;
    }
    
    .rsg-progress-indicator {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding: 1.5rem;
    }
    
    .rsg-progress-step {
        width: 100%;
    }
    
    .rsg-progress-connector {
        width: 2px;
        height: 20px;
        max-width: none;
        position: absolute;
        right: 17px;
        top: 100%;
    }
    
    .rsg-gender-selector {
        width: 100%;
        justify-content: center;
    }
    
    .rsg-size-table-grid {
        font-size: 0.875rem;
    }
    
    .rsg-size-table-grid th,
    .rsg-size-table-grid td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .rsg-header {
        padding: 1.5rem 1rem;
    }
    
    .rsg-sizing-side, .rsg-calculator-side {
        padding: 1.5rem 1rem;
    }
    
    .rsg-gender-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .rsg-size-table-grid {
        display: block;
        overflow-x: auto;
    }
    
    .rsg-measurement-buttons {
        grid-template-columns: 1fr;
    }
    
    .rsg-result-value {
        font-size: 2.5rem;
    }
}