/* Follow Button System - Final Design */
/* Version: 2024-01-15 - Desktop shows text, mobile shows only emoji */

.follow-button-container {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show container after JavaScript initializes */
.follow-button-container:not(:empty) {
    opacity: 1;
}

/* Hide buttons until JavaScript loads to prevent FOUC */
.follow-button-container:empty {
    min-height: 40px;
    min-width: 140px;
    display: inline-block;
}

@media (max-width: 768px) {
    .follow-button-container:empty {
        min-height: 32px;
        min-width: 90px;
    }
}

.follow-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    background: var(--tertiary-bg);
    color: var(--secondary-text);
    position: relative;
    min-width: 120px;
}

.follow-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.follow-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Icon styling */
.follow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.2s ease;
    width: 20px;
    height: 20px;
}

.follow-text {
    line-height: 1;
    white-space: nowrap;
}

/* CRITICAL: Desktop text must always show */
.follow-button .follow-text {
    display: inline !important;
    visibility: visible !important;
}

/* Mobile: Hide text only when button has hide class */
.follow-button.follow-btn-hide-text .follow-text {
    display: none !important;
}

/* Login Required State */
.follow-button-login {
    background: var(--tertiary-bg);
    color: var(--secondary-text);
    border: 2px solid var(--border-color);
}

.follow-button-login:hover:not(:disabled) {
    background: var(--hover-bg);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Premium Required State */
.follow-button-premium {
    background: var(--tertiary-bg);
    color: var(--secondary-text);
    border: 2px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.follow-button-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary-dark);
    opacity: 0.1;
    transition: left 0.3s ease;
}

.follow-button-premium:hover:not(:disabled) {
    background: var(--gradient-primary-dark);
    color: var(--accent-text);
    border-color: transparent;
    text-shadow: none;
}

.follow-button-premium:hover:not(:disabled)::before {
    left: 0;
}

/* Follow State */
.follow-button-follow {
    background: var(--tertiary-bg);
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
}

.follow-button-follow:hover:not(:disabled) {
    background: var(--hover-bg);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.follow-button-follow:hover .follow-icon {
    transform: scale(1.15);
}

/* Following State */
.follow-button-following {
    background: var(--gradient-primary-dark);
    color: var(--accent-text);
    border-color: transparent;
    text-shadow: none;
}

.follow-button-following:hover:not(:disabled) {
    background: var(--error-color);
    color: #ffffff;
}

.follow-button-following:hover .follow-icon {
    transform: rotate(15deg) scale(1.1);
}

/* Loading State */
.follow-button.loading .follow-icon {
    animation: spin 1s linear infinite;
}

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

/* Premium Modal */
.premium-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.premium-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.premium-modal-content {
    position: relative;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

.premium-modal-content h2 {
    margin: 0 0 16px 0;
    color: var(--primary-text);
    font-size: 24px;
}

.premium-modal-content p {
    margin: 0 0 24px 0;
    color: var(--secondary-text);
    font-size: 16px;
    line-height: 1.6;
}

.premium-features {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.premium-features .feature {
    padding: 8px 0;
    color: var(--secondary-text);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-features .feature::before {
    content: '✓';
    color: var(--accent-color);
    font-weight: bold;
    font-size: 16px;
}

.premium-modal-actions {
    display: flex;
    gap: 12px;
}

.premium-button {
    flex: 1;
    padding: 12px 24px;
    background: var(--gradient-primary-dark);
    color: var(--accent-text);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    text-shadow: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.premium-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    background: linear-gradient(135deg, #b7950b 0%, #b8860b 100%);
}

.cancel-button {
    flex: 1;
    padding: 12px 24px;
    background: var(--tertiary-bg);
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 14px;
}

.cancel-button:hover {
    background: var(--hover-bg);
    color: var(--primary-text);
    border-color: var(--accent-color);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    color: var(--primary-text);
    font-weight: 500;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10001;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    background: var(--tertiary-bg);
    border-color: var(--success-color);
}

.toast-success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-error {
    background: var(--tertiary-bg);
    border-color: var(--error-color);
}

.toast-error::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--error-color);
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .follow-button {
        min-width: auto;
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    .follow-icon {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    /* Mobile rule removed - already defined above */
    
    .premium-modal-content {
        padding: 24px;
        max-width: 90%;
    }
    
    .premium-modal-actions {
        flex-direction: column;
    }
    
    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .follow-button {
        padding: 8px;
    }
    
    .follow-icon {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
}

/* Page actions */
.company-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 1.5rem 0;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.75rem 0 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-actions h1 {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 150px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    line-height: 1.2;
    font-size: 24px;
    color: var(--primary-text);
    font-weight: 600;
}

.page-actions-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

/* Mobile page actions */
@media (max-width: 768px) {
    .page-actions {
        gap: 0.5rem;
        margin: 0.5rem 0 0.75rem 0;
    }
    
    .page-actions h1 {
        font-size: 18px !important;
        min-width: 0;
        max-width: calc(100% - 60px); /* Smaller button on mobile (emoji only) */
        flex: 1 1 auto;
    }
    
    .company-actions {
        margin: 0.75rem 0 1rem 0;
    }
}

@media (max-width: 480px) {
    .page-actions {
        margin: 0.5rem 0 0.5rem 0;
    }
    
    .page-actions h1 {
        font-size: 16px !important;
    }
}
