/**
 * YOOAdmin Extensions Store - Enhancements
 * Stars, Popup, Enhanced Buttons
 * 
 * @package YOOAdmin_Extended
 * @since 2.1.0
 */

/* ========== Rating Stars ========== */
.yp-ext-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    margin-bottom: 8px;
}

.yp-ext-rating .stars {
    font-size: 18px;
    color: #ffa500;
    letter-spacing: 0;
    line-height: 1;
}

.yp-ext-rating .rating-count {
    font-size: 13px;
    color: var(--yooadmin-text-secondary, #646970);
    margin-left: 2px;
}

/* ========== Version Styling ========== */
.yp-ext-version {
    font-weight: 600;
    color: var(--yooadmin-text-secondary, #646970);
}

/* ========== Author Color ========== */

.yp-ext-card .yp-ext-author::first-letter,
.yp-ext-card .yp-ext-author::first-line {
    color: inherit;
}

.yp-ext-author-by {
    font-weight: 400;
}

.yp-ext-author-name {
    color: var(--yooadmin-primary, #eda934) !important;
}

/* ========== Upgrade Link ========== */
.yp-upgrade-link {
    display: inline-block;
    margin-left: 10px;
    color: #667eea !important;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.yp-upgrade-link:hover {
    color: #764ba2 !important;
    text-decoration: underline;
}

/* ========== View Details Button ========== */
.yp-ext-details {
    color: var(--yooadmin-primary, #eda934) !important;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}

.yp-ext-details:hover {
    color: var(--yooadmin-primary-dark, #d88a2f) !important;
    text-decoration: underline;
}

/* ========== Purchase/Activate License Button (outline — readable on white) ========== */
.yp-ext-actions .button-purchase,
.yp-ext-actions a.button-purchase,
a.button.button-purchase,
.yp-ext-popup-footer .button-purchase,
.yp-ext-popup-footer a.button-purchase {
    border-color: var(--yooadmin-primary, #eda934) !important;
    background: #fff !important;
    color: var(--yooadmin-primary, #eda934) !important;
    font-weight: 600;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.yp-ext-actions .button-purchase:hover,
.yp-ext-actions a.button-purchase:hover,
a.button.button-purchase:hover,
.yp-ext-popup-footer .button-purchase:hover,
.yp-ext-popup-footer a.button-purchase:hover,
.yp-ext-actions .button-purchase:focus,
.yp-ext-actions a.button-purchase:focus,
a.button.button-purchase:focus,
.yp-ext-popup-footer .button-purchase:focus,
.yp-ext-popup-footer a.button-purchase:focus {
    border-color: var(--yooadmin-primary-dark, #d88a2f) !important;
    background: #fffaf3 !important;
    color: var(--yooadmin-primary-dark, #c97d28) !important;
}

.yp-ext-actions .button-purchase::before,
.yp-ext-actions a.button-purchase::before,
a.button.button-purchase::before,
.yp-ext-popup-footer .button-purchase::before,
.yp-ext-popup-footer a.button-purchase::before {
    content: none !important;
}

/* ========== Update Button ========== */
.yp-ext-actions .button-update {
    border-color: #ff9800;
    color: #fff;
    font-weight: 400;
    position: relative;
    animation: pulse 2s infinite;
}

.yp-ext-actions .button-update:hover {
    background: #f57c00;
    border-color: #f57c00;
}

/* Removed icon - text only */

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 152, 0, 0);
    }
}

/* ========== Uninstall Button ========== */
.yp-ext-actions .button-danger {
    background: #fff;
    border-color: #dc3545;
    color: #dc3545;
    font-weight: 600;
}

.yp-ext-actions .button-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* ========== Buy Now Button (Secondary) ========== */
.yp-ext-popup-footer .button-secondary,
.yp-ext-popup-footer a.button-secondary,
.yp-ext-actions .button-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.yp-ext-popup-footer .button-secondary,
.yp-ext-popup-footer a.button-secondary {
    background: #fff !important;
    border-color: var(--yooadmin-primary, #eda934) !important;
    color: var(--yooadmin-primary, #eda934) !important;
    font-weight: 600 !important;
}

.yp-ext-popup-footer .button-secondary:hover,
.yp-ext-popup-footer a.button-secondary:hover {
    background: #fffaf3 !important;
    border-color: var(--yooadmin-primary-dark, #d88a2f) !important;
    color: var(--yooadmin-primary-dark, #c97d28) !important;
}

/* ========== Button Separator (or) ========== */
.yp-button-separator {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    color: var(--yooadmin-text-secondary, #646970);
    font-size: 13px;
    font-weight: 500;
    text-transform: lowercase;
}

/* ========== Popup Overlay ========== */
.yp-ext-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== Popup Container ========== */
.yp-ext-popup {
    background: #fff;
    border-radius: 8px;
    max-width: 1000px;
    width: 100%;
    max-height: 93vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== Popup Close Button ========== */
.yp-ext-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.yp-ext-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* ========== Popup Header ========== */
.yp-ext-popup-header {
    position: relative;
    padding: 30px 24px 13px;
    border-bottom: 1px solid #dcdcde;
}

.yp-ext-popup-banner {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

.yp-ext-popup-title-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.yp-ext-popup-title {
    flex: 1;
}

.yp-ext-popup-title h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: var(--yp-text);
}

.yp-ext-popup-title .yp-ext-author {
    margin: 0;
    font-size: 14px;
    color: var(--yooadmin-text-secondary, #646970);
}

.yp-ext-popup-header .yp-ext-popup-tags {
    display: flex;
	margin: 0 33px 0 0;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* ========== Popup Body ========== */
.yp-ext-popup-body {
    padding: 20px;
}

.yp-ext-popup-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.yp-ext-popup-meta span {
    color: #50575e;
}

.yp-ext-popup-meta strong {
    color: var(--yp-text);
    font-weight: 600;
}

.yp-ext-popup-description h3,
.yp-ext-popup-changelog h3,
.yp-ext-popup-tags-info h3 {
    font-size: 16px;
    color: var(--yp-text);
    margin: 0 0 12px 0;
    font-weight: 600;
}

.yp-ext-popup-description {
    margin-bottom: 20px;
}

.yp-ext-popup-description p {
    color: #50575e;
    line-height: 1.6;
    margin: 0;
}

.yp-ext-popup-changelog {
    margin-bottom: 20px;
    padding: 15px;
    background: #f6f7f7;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
}

.yp-ext-popup-changelog .changelog-content {
    color: #50575e;
    line-height: 1.6;
    font-size: 14px;
}

/* ========== Tags Explanation ========== */
.yp-tags-explanation {
    list-style: none;
    padding: 0;
    margin: 0;
}

.yp-tags-explanation li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: #f6f7f7;
    border-radius: 6px;
    font-size: 14px;
    color: #50575e;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tag-badge.tag-free {
    background: #e7f5ff;
    color: #1971c2;
}

.tag-badge.tag-basic {
    background: #fff3e0;
    color: #e65100;
}

.tag-badge.tag-pro {
    background: #2271b1;
    color: #fff;
}

.tag-badge.tag-included {
    background: #e8f5e9;
    color: #2e7d32;
}

.tag-badge.tag-not-included {
    background: #ffebee;
    color: #c62828;
}

.tag-badge.tag-price {
    background: #fff9c4;
    color: #f57f17;
}

/* ========== Popup Footer ========== */
.yp-ext-popup-footer {
    padding: 20px;
    border-top: 1px solid #dcdcde;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.yp-ext-popup-footer .button {
    flex: 1;
    max-width: 200px;
    min-width: 126px;
    overflow: visible;
    position: relative;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.yp-ext-popup-footer .button .spinner {
    float: none;
    margin: 0;
    vertical-align: middle;
    display: inline-block;
}

/* ========== Card Enhancements ========== */
.yp-ext-header .yp-ext-tags {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    display: flex;
    justify-content: center;
    padding: 0 0 9px 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 12px;
    width: 100%;
}

.yp-extension-card .yp-ext-header {
    display: flex;
    flex-direction: column;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 12px;
}

.yp-ext-popup-header .yp-ext-popup-tags {
    justify-content: flex-end;
}

.yp-ext-tag--single {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    max-width: 100%;
    flex-wrap: wrap;
    cursor: pointer;
    border: 1px solid transparent;
}

.yp-ext-tag--single.is-free {
    background: #e7f5ff;
    color: #1971c2;
    border-color: #b6dfff;
}

.yp-ext-tag--single.is-included-tier {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.yp-ext-tag--single.is-locked {
    background: #ffebee;
    color: #b71c1c;
    border-color: #ffcdd2;
}

.yp-variant-meta.not-included {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #c62828;
}

.yp-variant-not-included {
    color: #c62828 !important;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .yp-ext-popup {
        max-width: 100%;
        margin: 10px;
    }
    
    .yp-ext-popup-banner {
        height: 150px;
    }
    
    .yp-ext-popup-meta {
        flex-direction: column;
        gap: 8px;
    }
}
