/**
 * User Product Affiliate Links - Styles
 * Version: 1.0.0
 */

/* ===============================================
   Affiliate Link Box on Product Page
   =============================================== */

.upal-affiliate-box {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.upal-affiliate-box .upal-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.upal-affiliate-box .upal-title:before {
    content: "🔗";
    margin-right: 8px;
    font-size: 20px;
}

.upal-link-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.upal-link-input {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #555;
    font-family: monospace;
}

.upal-link-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.upal-copy-button {
    padding: 10px 20px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.upal-copy-button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.upal-copy-button:active {
    transform: translateY(0);
}

.upal-copy-feedback {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #46b450;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upal-copy-feedback.show {
    opacity: 1;
}

/* ===============================================
   My Account Page - Affiliate Product Links
   =============================================== */

.upal-account-page {
    padding: 20px 0;
}

.upal-account-page h2 {
    margin-bottom: 10px;
    font-size: 24px;
    color: #333;
}

.upal-account-page > p {
    margin-bottom: 25px;
    color: #666;
    font-size: 14px;
}

.upal-products-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.upal-products-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.upal-products-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upal-products-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.upal-products-table tbody tr:hover {
    background-color: #f8f9fa;
}

.upal-products-table tbody tr:last-child {
    border-bottom: none;
}

.upal-products-table td {
    padding: 15px;
    font-size: 14px;
    color: #555;
    vertical-align: middle;
}

.upal-product-name a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.upal-product-name a:hover {
    color: #005a87;
    text-decoration: underline;
}

.upal-product-link .upal-link-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.upal-link-input-small {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    background: #f9f9f9;
    color: #555;
    font-family: monospace;
}

.upal-link-input-small:focus {
    outline: none;
    border-color: #007cba;
    background: #fff;
}

.upal-copy-button-small {
    padding: 8px 16px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.upal-copy-button-small:hover {
    background: #005a87;
}

.upal-copy-button-small:active {
    transform: scale(0.95);
}

.upal-visits-count {
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: #007cba;
}

/* ===============================================
   Pagination Styles
   =============================================== */

.upal-pagination-info {
    margin: 0 0 15px 0;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.upal-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.upal-pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.upal-pagination-link {
    display: inline-block;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.upal-pagination-link:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.2);
}

.upal-pagination-link.upal-current {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
    cursor: default;
    font-weight: 600;
}

.upal-pagination-link.upal-current:hover {
    transform: none;
    box-shadow: none;
}

.upal-pagination-link.upal-prev,
.upal-pagination-link.upal-next {
    padding: 8px 18px;
    font-weight: 600;
}

.upal-pagination-ellipsis {
    padding: 8px 6px;
    color: #999;
    font-size: 14px;
    font-weight: 600;
}

/* ===============================================
   Responsive Design
   =============================================== */

@media screen and (max-width: 768px) {
    .upal-link-container {
        flex-direction: column;
    }
    
    .upal-link-input {
        min-width: 100%;
    }
    
    .upal-copy-button {
        width: 100%;
    }
    
    .upal-products-table {
        font-size: 12px;
    }
    
    .upal-products-table th,
    .upal-products-table td {
        padding: 10px;
    }
    
    .upal-link-input-small {
        min-width: 150px;
        font-size: 11px;
    }
    
    .upal-copy-button-small {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .upal-pagination {
        gap: 5px;
    }
    
    .upal-pagination-link {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 35px;
    }
    
    .upal-pagination-link.upal-prev,
    .upal-pagination-link.upal-next {
        padding: 6px 12px;
    }
}

@media screen and (max-width: 600px) {
    .upal-products-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .upal-products-table thead {
        display: none;
    }
    
    .upal-products-table tbody,
    .upal-products-table tr,
    .upal-products-table td {
        display: block;
    }
    
    .upal-products-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        padding: 10px;
    }
    
    .upal-products-table td {
        padding: 8px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .upal-products-table td:last-child {
        border-bottom: none;
    }
    
    .upal-products-table td:before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 5px;
        color: #333;
        font-size: 12px;
        text-transform: uppercase;
    }
    
    .upal-product-link .upal-link-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upal-link-input-small {
        width: 100%;
    }
    
    .upal-copy-button-small {
        width: 100%;
    }
}

/* ===============================================
   Admin Page Styles
   =============================================== */

.upal-admin-page {
    max-width: 1200px;
}

.upal-admin-page .card {
    margin-top: 20px;
    padding: 20px;
}

.upal-admin-page .card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.upal-admin-page .card ul {
    list-style: none;
    padding-left: 0;
}

.upal-admin-page .card ul li {
    padding: 8px 0;
    font-size: 14px;
}
