/**
 * AVSOPS Follow System Styles
 * Updated: Follow/Following with follower counts
 */

/* =========================================================
   FOLLOW BUTTON WRAPPER
   ========================================================= */
.avsops-follow-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

/* =========================================================
   FOLLOW BUTTON
   ========================================================= */
.avsops-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: #fff;
    border: 2px solid #002868;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #002868;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.avsops-follow-btn:hover {
    background: #002868;
    color: #fff;
}

.avsops-follow-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 40, 104, 0.25);
}

/* Follow icon */
.avsops-follow-btn .follow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.avsops-follow-btn .follow-icon svg {
    width: 18px;
    height: 18px;
}

.avsops-follow-btn:hover .follow-icon {
    transform: scale(1.1);
}

/* Following state (active) */
.avsops-follow-btn.is-following {
    background: #002868;
    border-color: #002868;
    color: #fff;
}

.avsops-follow-btn.is-following:hover {
    background: #BF0A30;
    border-color: #BF0A30;
    color: #fff;
}

.avsops-follow-btn.is-following:hover .follow-text::after {
    content: ' (Unfollow)';
    font-size: 0.8em;
    opacity: 0.8;
}

/* Loading state */
.avsops-follow-btn.is-loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.avsops-follow-btn.is-loading .follow-icon svg {
    animation: avsops-spin 1s linear infinite;
}

@keyframes avsops-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Login required state */
.avsops-follow-btn.requires-login {
    background: #f8f9fa;
    border-color: #ccc;
    color: #666;
}

.avsops-follow-btn.requires-login:hover {
    border-color: #002868;
    color: #002868;
    background: #e8f4fc;
}

/* =========================================================
   FOLLOWER COUNT BADGE
   ========================================================= */
.avsops-follower-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.35rem 0.6rem;
    background: #f0f0f0;
    color: #444;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: default;
    transition: all 0.2s ease;
}

.avsops-follower-count:hover {
    background: #e0e0e0;
}

/* When has followers, make it more prominent */
.avsops-follow-wrap:has(.is-following) .avsops-follower-count {
    background: rgba(0, 40, 104, 0.1);
    color: #002868;
}

/* =========================================================
   FEEDBACK TOOLTIP
   ========================================================= */
.avsops-follow-feedback {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    margin-left: 0.5rem;
    background: #333;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 4px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.avsops-follow-feedback--success {
    background: #28a745;
}

.avsops-follow-feedback--error {
    background: #dc3545;
}

.avsops-follow-feedback.fade-out {
    opacity: 0;
}

/* =========================================================
   BUTTON VARIANTS
   ========================================================= */

/* Small button */
.avsops-follow-btn.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    gap: 0.35rem;
}

.avsops-follow-btn.btn-sm .follow-icon svg {
    width: 14px;
    height: 14px;
}

/* Large button */
.avsops-follow-btn.btn-lg {
    padding: 0.8rem 1.6rem;
    font-size: 1.1rem;
    gap: 0.6rem;
}

.avsops-follow-btn.btn-lg .follow-icon svg {
    width: 22px;
    height: 22px;
}

/* Icon only button */
.avsops-follow-btn.icon-only {
    padding: 0.6rem;
    border-radius: 50%;
}

.avsops-follow-btn.icon-only .follow-text {
    display: none;
}

/* Full width button */
.avsops-follow-btn.btn-block {
    width: 100%;
    justify-content: center;
}

/* =========================================================
   FOLLOWING CARD (for dashboard)
   ========================================================= */
.avsops-follow-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #002868;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.avsops-follow-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.avsops-follow-card .card-content {
    flex: 1;
}

.avsops-follow-card .card-title {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.avsops-follow-card .card-title a {
    color: #002868;
    text-decoration: none;
}

.avsops-follow-card .card-title a:hover {
    color: #BF0A30;
    text-decoration: underline;
}

.avsops-follow-card .card-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.avsops-follow-card .card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 1rem;
}

.avsops-follow-card .card-date {
    font-size: 0.8rem;
    color: #888;
}

.avsops-follow-card .card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-shrink: 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .avsops-follow-wrap {
        flex-wrap: wrap;
    }

    .avsops-follow-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .avsops-follow-btn .follow-icon svg {
        width: 16px;
        height: 16px;
    }

    .avsops-follow-card {
        flex-direction: column;
    }

    .avsops-follow-card .card-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* =========================================================
   INTEGRATION WITH ORGANIZATION TEMPLATES
   ========================================================= */

/* In header area */
.avsops-hq-header .avsops-follow-wrap,
.avsops-local-header .avsops-follow-wrap,
.avsops-state-header .avsops-follow-wrap {
    margin-top: 1rem;
}

/* In action buttons area */
.avsops-action-buttons .avsops-follow-btn {
    background: #fff;
    border: 2px solid #002868;
    color: #002868;
}

.avsops-action-buttons .avsops-follow-btn:hover {
    background: #002868;
    color: #fff;
}

.avsops-action-buttons .avsops-follow-btn.is-following {
    background: #002868;
    color: #fff;
}

.avsops-action-buttons .avsops-follow-btn.is-following:hover {
    background: #BF0A30;
    border-color: #BF0A30;
}

/* =========================================================
   LEGACY SUPPORT (backwards compatibility)
   ========================================================= */
.avsops-favorite-btn {
    /* Map old class to new styles */
}

.avsops-favorites-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #002868;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
}
