/* Affiliate Product Header */
.affiliate_product_header {
    display: flex;
    align-items: center;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    padding: 0;
    height: 50px;
}

/* Left: Logo & Program Name */
.affiliate-logo-container {
    display: flex;
    align-items: center;
    background: #FAD1E4;
    padding: 10px 20px 10px 35px;
    font-weight: bold;
    color: #003366;
    position: relative;
    border-radius: 50px 0 0 50px; /* Reversed for RTL */
    margin: 0;
    gap: 10px;
    white-space: nowrap;
    min-width: fit-content;
    height: 100%;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1); /* Shadow on left side for RTL */
}

.program-name {
    font-size: 16px;
    font-weight: bold;
    color: #003366;
    white-space: nowrap;
}

/* Middle: Category & Commission */
.affiliate-details {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    color: #333;
    font-size: 14px;
    margin-right: 10px; /* Changed from margin-left */
    flex: 1;
    padding: 0 20px;
    min-width: 0;
    height: 100%;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    white-space: nowrap;
}

.category-label,
.commission-label {
    font-weight: bold;
    color: #777;
    font-size: 12px;
}

.category-value,
.commission-value {
    font-weight: bold;
    font-size: 14px;
}

/* Right: Actions */
.affiliate-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 40px; /* Swapped padding */
    padding-left: 25px;
    border-right: 1px solid #ccc; /* Changed from border-left */
    margin-right: auto; /* Swapped margins */
    margin-left: 10px;
    min-width: fit-content;
    height: 100%;
}

.get-link-container {
    position: relative;
}

.get-link-btn {
    background: #FF3F98;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.get-link-dropdown {
    position: absolute;
    top: calc(100% + 28px);
    left: 0; /* Changed from right */
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 420px;
    display: none;
    z-index: 1000;
    padding: 25px;
}

.get-link-dropdown.active {
    display: block;
}

.get-link-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-input-container {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 12px;
    background-color: #F2F4F9;
    width: 100%;
    box-sizing: border-box;
}

.link-input {
    flex: 1;
    border: none;
    background: #F2F4F9;
    color: #333;
    font-size: 14px;
    outline: none;
    width: 100%;
    padding: 10px;
    border-radius: 0 12px 12px 0 !important; /* Reversed for RTL */
    text-align: right; /* Added for RTL */
}

.copy-btn {
    background: #FF3F98;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px 12px 12px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-right: -4px; /* Changed from margin-left */
    height: 48px;
}

.link-options {
    display: flex;
    gap: 24px;
    padding-right: 8px; /* Changed from padding-left */
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-option input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #FF3F98;
    border-radius: 50%;
    cursor: pointer;
    background: white;
    position: relative;
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FF3F98;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-label {
    font-size: 14px;
    color: #444;
    font-weight: 400;
}

.link-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding-bottom: 9px;
    display: flex;
    align-items: center;
}

/* Settings Icon and Dropdown */
.settings-container {
    position: relative;
    display: flex;
    align-items: center;
}

.settings-icon {
    height: 22px;
    cursor: pointer;
    margin-left: 20px; /* Changed from margin-right */
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.settings-icon:hover {
    opacity: 1;
}

.settings-dropdown {
    position: absolute;
    top: calc(100% + 28px);
    left: 20px; /* Changed from right */
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 180px;
    display: none;
    z-index: 1000;
    padding: 6px 0;
}

.settings-dropdown.active {
    display: block;
}

.settings-dropdown-title {
    color: #333;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 20px 12px;
    position: relative;
    margin-bottom: 4px;
}

.settings-dropdown-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 25px; /* Changed from left */
    left: 25px;
    height: 1px;
    background: #eee;
}

.settings-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-dropdown li {
    padding: 6px 16px;
    cursor: pointer;
    margin: 0 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.settings-dropdown li:hover {
    background: #F8F9FA;
}

.settings-dropdown li a {
    color: #FF3F98;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-weight: 400;
    padding: 6px 0;
    font-size: 13px;
}

.settings-dropdown li:hover a {
    opacity: 0.8;
}

.settings-dropdown li img {
    width: 20px;
    height: 20px;
    margin-left: 10px; /* Changed from margin-right */
    opacity: 1;
    transition: opacity 0.2s ease;
}

.settings-dropdown li:hover img {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .affiliate_product_header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 10px;
    }

    .affiliate-logo-container {
        flex-direction: row;
        align-items: center;
        text-align: right; /* Changed from left */
    }

    .affiliate-details {
        flex-direction: row;
        gap: 15px;
        text-align: right; /* Changed from left */
        margin-right: 0; /* Changed from margin-left */
    }

    .affiliate-actions {
        border-right: none; /* Changed from border-left */
        padding-right: 0; /* Changed from padding-left */
        margin-right: 0; /* Changed from margin-left */
        flex-direction: column;
    }
}
