/* Frontend CSS - Updated with Publishing Styles */

/* Pin Button */
.aibw-ppg-button-wrapper {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #e60023 0%, #bd081c 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(230, 0, 35, 0.3);
}

.aibw-ppg-pin-button {
    background: white;
    color: #e60023;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.aibw-ppg-pin-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #f5f5f5;
}

/* Modal */
.aibw-ppg-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.aibw-ppg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.aibw-ppg-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: aibw-ppg-modal-in 0.3s ease-out;
}

@keyframes aibw-ppg-modal-in {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Modal Header */
.aibw-ppg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #f0f0f1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.aibw-ppg-modal-header h2 {
    margin: 0;
    color: white;
    font-size: 24px;
}

.aibw-ppg-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.aibw-ppg-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Body */
.aibw-ppg-modal-body {
    padding: 30px;
}

/* Loading */
.aibw-ppg-loading {
    padding: 60px 30px;
    text-align: center;
}

.aibw-ppg-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #e60023;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.aibw-ppg-loading p {
    font-size: 16px;
    color: #666;
}

/* Sections */
.aibw-ppg-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.aibw-ppg-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.aibw-ppg-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aibw-ppg-regenerate-btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.aibw-ppg-regenerate-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
}

/* Image Preview */
.aibw-ppg-image-preview {
    text-align: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.aibw-ppg-image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Titles List */
.aibw-ppg-titles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aibw-ppg-title-option {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.aibw-ppg-title-option:hover {
    border-color: #e60023;
    box-shadow: 0 4px 15px rgba(230, 0, 35, 0.2);
    transform: translateX(5px);
}

.aibw-ppg-title-option.selected {
    border-color: #e60023;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
}

.aibw-ppg-title-option::before {
    content: '📌';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.aibw-ppg-title-option.selected::before {
    opacity: 1;
}

/* Textarea */
.aibw-ppg-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s;
}

.aibw-ppg-section textarea:focus {
    outline: none;
    border-color: #e60023;
}

/* Character Count */
.aibw-ppg-char-count {
    text-align: right;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.aibw-ppg-char-count.warning {
    color: #ff9800;
    font-weight: bold;
}

.aibw-ppg-char-count.error {
    color: #f44336;
    font-weight: bold;
}

/* Hashtags Container */
.aibw-ppg-hashtags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.aibw-ppg-hashtag {
    background: linear-gradient(135deg, #e60023 0%, #bd081c 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.aibw-ppg-hashtag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(230, 0, 35, 0.3);
}

.aibw-ppg-hashtag-remove {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s;
}

.aibw-ppg-hashtag-remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Keywords */
.aibw-ppg-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.aibw-ppg-keyword {
    background: #fff3cd;
    color: #856404;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
}

/* SEO Score */
.aibw-ppg-seo-score {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.aibw-ppg-score-bar {
    height: 30px;
    background: #f0f0f1;
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.aibw-ppg-score-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    border-radius: 15px;
    transition: width 0.8s ease-out;
}

.aibw-ppg-score-text {
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(135deg, #e60023 0%, #bd081c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Publishing Footer */
.aibw-ppg-publishing-footer {
    padding: 25px 30px;
    border-top: 2px solid #f0f0f1;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0 0 16px 16px;
}

.aibw-ppg-publish-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.aibw-ppg-publish-icon {
    font-size: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.aibw-ppg-publish-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.aibw-ppg-publish-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.aibw-ppg-publish-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    transition: left 0.5s;
}

.aibw-ppg-publish-btn:hover::before {
    left: 100%;
}

.aibw-ppg-publish-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.aibw-ppg-btn-icon {
    font-size: 32px;
    transition: transform 0.3s;
}

.aibw-ppg-publish-btn:hover .aibw-ppg-btn-icon {
    transform: scale(1.2) rotate(10deg);
}

.aibw-ppg-btn-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.aibw-ppg-btn-text strong {
    font-size: 16px;
    color: #333;
}

.aibw-ppg-btn-text small {
    font-size: 12px;
    color: #666;
}

/* Individual button colors */
.aibw-ppg-share-link-btn:hover {
    border-color: #E60023;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
}

.aibw-ppg-standard-pin-btn:hover {
    border-color: #BD081C;
    background: linear-gradient(135deg, #fff0f0 0%, #ffd0d0 100%);
}

.aibw-ppg-download-btn:hover {
    border-color: #2271B1;
    background: linear-gradient(135deg, #f0f7ff 0%, #e0efff 100%);
}

.aibw-ppg-copy-all-btn:hover {
    border-color: #46B450;
    background: linear-gradient(135deg, #f0fff0 0%, #e0ffe0 100%);
}

.aibw-ppg-close-footer-btn {
    width: 100%;
    padding: 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.aibw-ppg-close-footer-btn:hover {
    background: #f8f9fa;
    border-color: #999;
    color: #333;
}

/* Toast Notification */
.aibw-ppg-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 9999999;
    animation: toast-in 0.3s ease-out;
    min-width: 300px;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aibw-ppg-toast-icon {
    font-size: 24px;
}

.aibw-ppg-toast-message {
    font-size: 15px;
    color: #333;
    flex: 1;
}

.aibw-ppg-toast.success {
    border-left: 4px solid #46B450;
}

.aibw-ppg-toast.error {
    border-left: 4px solid #DC3232;
}

.aibw-ppg-toast.info {
    border-left: 4px solid #2271B1;
}

.aibw-ppg-toast.warning {
    border-left: 4px solid #FF9800;
}

/* Error Message */
.aibw-ppg-error-message {
    padding: 60px 30px;
    text-align: center;
}

.aibw-ppg-error-message p {
    font-size: 16px;
    margin: 10px 0;
}

.aibw-ppg-error-message .aibw-ppg-error-details {
    color: #f44336;
    font-size: 14px;
}

.aibw-ppg-retry {
    margin-top: 20px;
    background: #2271b1;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.aibw-ppg-retry:hover {
    background: #135e96;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .aibw-ppg-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .aibw-ppg-modal-header,
    .aibw-ppg-modal-body,
    .aibw-ppg-publishing-footer {
        padding: 15px;
    }
    
    .aibw-ppg-modal-header h2 {
        font-size: 18px;
    }
    
    .aibw-ppg-section {
        padding: 15px;
    }
    
    .aibw-ppg-publish-methods {
        grid-template-columns: 1fr;
    }
    
    .aibw-ppg-toast {
        bottom: 15px;
        right: 15px;
        left: 15px;
        min-width: auto;
    }
}

/* Scrollbar */
.aibw-ppg-modal-content::-webkit-scrollbar {
    width: 10px;
}

.aibw-ppg-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.aibw-ppg-modal-content::-webkit-scrollbar-thumb {
    background: #e60023;
    border-radius: 5px;
}

.aibw-ppg-modal-content::-webkit-scrollbar-thumb:hover {
    background: #bd081c;
}
/* ===== Quality Analyzer Styles ===== */

#aibw-ppg-quality-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

#aibw-ppg-quality-section h3 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.aibw-ppg-quality-header {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 25px;
    align-items: center;
    margin-bottom: 20px;
}

/* Score Circle */
.aibw-ppg-overall-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.aibw-ppg-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 6px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    transition: all 0.5s;
    position: relative;
}

.aibw-ppg-score-circle::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    padding: 6px;
    background: conic-gradient(
        from 0deg,
        #ff6b6b 0deg,
        #ffd93d calc(var(--score, 0) * 1.8deg),
        #6bcf7f calc(var(--score, 0) * 3.6deg),
        rgba(255,255,255,0.2) calc(var(--score, 0) * 3.6deg)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    animation: rotateScore 1s ease-out;
}

@keyframes rotateScore {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.aibw-ppg-score-circle.score-excellent {
    border-color: #6bcf7f;
    box-shadow: 0 0 30px rgba(107, 207, 127, 0.5);
}

.aibw-ppg-score-circle.score-good {
    border-color: #ffd93d;
    box-shadow: 0 0 30px rgba(255, 217, 61, 0.5);
}

.aibw-ppg-score-circle.score-fair {
    border-color: #ff9f43;
    box-shadow: 0 0 30px rgba(255, 159, 67, 0.5);
}

.aibw-ppg-score-circle.score-poor {
    border-color: #ff6b6b;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.aibw-ppg-score-label {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    opacity: 0.9;
}

/* Quality Details */
.aibw-ppg-quality-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.aibw-ppg-quality-item {
    background: rgba(255,255,255,0.1);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.aibw-ppg-quality-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(5px);
}

.aibw-ppg-quality-icon {
    font-size: 20px;
}

.aibw-ppg-quality-item span:nth-child(2) {
    flex: 1;
    opacity: 0.8;
    font-size: 13px;
}

.aibw-ppg-quality-item strong {
    font-size: 18px;
    font-weight: bold;
}

/* Suggestions */
.aibw-ppg-suggestions {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.aibw-ppg-suggestions h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: white;
}

.aibw-ppg-suggestions ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.aibw-ppg-suggestions li {
    padding: 8px 0 8px 25px;
    position: relative;
    font-size: 13px;
    line-height: 1.6;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.aibw-ppg-suggestions li:last-child {
    border-bottom: none;
}

.aibw-ppg-suggestions li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: 8px;
    font-weight: bold;
}

/* AI Words Warning */
.aibw-ppg-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid rgba(255, 193, 7, 0.5);
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.aibw-ppg-warning-icon {
    font-size: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 768px) {
    .aibw-ppg-quality-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .aibw-ppg-quality-details {
        grid-template-columns: 1fr;
    }
    
    .aibw-ppg-score-circle {
        width: 100px;
        height: 100px;
        font-size: 28px;
    }
}