/**
 * Professional Author Box Styles
 * Modern, clean design for Benson Varghese author box
 */

/* ===== MAIN AUTHOR BOX CONTAINER ===== */

.professional-author-box {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem auto;
    max-width: 1300px; /* Match post-content-container width */
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.professional-author-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #22c55e 0%, #3b82f6 50%, #22c55e 100%);
    border-radius: 12px 12px 0 0;
}

/* ===== AUTHOR HEADER SECTION ===== */

.author-box__header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.author-box__content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.author-box__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid #e9ecef;
}

.author-box__info {
    flex: 1;
}

.author-box__name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: #212529;
}

.author-box__title {
    font-size: 1rem;
    font-weight: 600;
    color: #22c55e;
    margin: 0 0 0.5rem 0;
}

.author-box__company {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0 0 1rem 0;
}

.author-box__bio {
    line-height: 1.6;
    color: #495057;
    margin: 0;
    font-size: 0.95rem;
}

/* ===== AUTHOR BIO SECTION ===== */

.author-box__bio {
    margin-bottom: 32px;
}

.author-box__bio p {
    font-size: 1rem;
    line-height: 1.7;
    color: #475569;
    margin: 0 0 16px 0;
}

.author-box__bio p:last-child {
    margin-bottom: 0;
}

/* ===== PUBLICATION DATES SECTION ===== */

.author-box__dates {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    padding: 20px;
    background: rgba(82, 184, 128, 0.05);
    border-radius: 12px;
    border-left: 4px solid #52B880;
}

.date-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #52B880;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-value {
    font-size: 1rem;
    font-weight: 500;
    color: #1e293b;
}

/* ===== SHARE BUTTONS SECTION ===== */

.author-box__share {
    margin-bottom: 32px;
}

.share-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 44px; /* Touch-friendly */
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.share-btn--twitter:hover {
    border-color: #1da1f2;
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.05);
}

.share-btn--linkedin:hover {
    border-color: #0077b5;
    color: #0077b5;
    background: rgba(0, 119, 181, 0.05);
}

.share-btn--email:hover {
    border-color: #ea4335;
    color: #ea4335;
    background: rgba(234, 67, 53, 0.05);
}

.share-btn--copy:hover {
    border-color: #52B880;
    color: #52B880;
    background: rgba(82, 184, 128, 0.05);
}

.share-btn svg {
    flex-shrink: 0;
}

/* ===== AUTHOR SOCIAL LINKS SECTION ===== */

.author-box__social {
    border-top: 1px solid #f1f5f9;
    padding-top: 24px;
    margin-bottom: 32px;
}

.social-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.social-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.social-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.social-link--twitter:hover {
    background: rgba(29, 161, 242, 0.1);
    color: #1da1f2;
    border-color: #1da1f2;
}

.social-link--linkedin:hover {
    background: rgba(0, 119, 181, 0.1);
    color: #0077b5;
    border-color: #0077b5;
}

.social-link--website:hover {
    background: rgba(82, 184, 128, 0.1);
    color: #52B880;
    border-color: #52B880;
}

.social-link svg {
    flex-shrink: 0;
}

/* ===== TAPPED IN PLAYLIST SECTION ===== */

.author-box__playlist {
    border-top: 1px solid #f1f5f9;
    padding-top: 32px;
}

.playlist-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 16px 0;
}

.playlist-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #64748b;
    margin: 0 0 24px 0;
}

.playlist-video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    background: #f1f5f9;
}

.playlist-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== DARK MODE SUPPORT ===== */

@media (prefers-color-scheme: dark) {
    .professional-author-box {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .author-box__name {
        color: #f1f5f9;
    }
    
    .author-box__title {
        color: #4ade80;
    }
    
    .author-box__company {
        color: #94a3b8;
    }
    
    .author-box__bio p {
        color: #cbd5e1;
    }
    
    .author-box__dates {
        background: rgba(82, 184, 128, 0.1);
        border-left-color: #4ade80;
    }
    
    .date-label {
        color: #4ade80;
    }
    
    .date-value {
        color: #f1f5f9;
    }
    
    .share-title,
    .social-title {
        color: #f1f5f9;
    }
    
    .share-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }
    
    .share-btn:hover {
        background: #475569;
    }
    
    .social-link {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }
    
    .social-link:hover {
        background: #475569;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet styles */
@media (max-width: 768px) {
    .professional-author-box {
        padding: 32px 24px;
        margin: 40px 0;
        border-radius: 16px;
    }
    
    .author-box__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
        margin-bottom: 28px;
    }
    
    .author-avatar-professional {
        width: 100px;
        height: 100px;
    }
    
    .author-box__name {
        font-size: 1.75rem;
    }
    
    .author-box__dates {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .share-buttons {
        gap: 8px;
    }
    
    .share-btn {
        padding: 10px 16px;
        font-size: 0.8125rem;
    }
    
    .social-links {
        gap: 12px;
        justify-content: center;
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    .professional-author-box {
        padding: 24px 20px;
        margin: 32px 0;
        border-radius: 12px;
    }
    
    .author-box__header {
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .author-avatar-professional {
        width: 80px;
        height: 80px;
    }
    
    .author-box__name {
        font-size: 1.5rem;
    }
    
    .author-box__title {
        font-size: 1rem;
    }
    
    .author-box__company {
        font-size: 0.875rem;
    }
    
    .author-box__bio p {
        font-size: 0.9375rem;
        line-height: 1.6;
    }
    
    .author-box__dates {
        padding: 12px;
        gap: 12px;
    }
    
    .date-label {
        font-size: 0.8125rem;
    }
    
    .date-value {
        font-size: 0.9375rem;
    }
    
    .share-title,
    .social-title {
        font-size: 1rem;
    }
    
    .share-buttons {
        gap: 6px;
    }
    
    .share-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
        min-height: 40px;
    }
    
    .share-btn span {
        display: none; /* Show only icons on very small screens */
    }
    
    .social-links {
        gap: 8px;
        justify-content: center;
    }
    
    .social-link {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .professional-author-box {
        padding: 20px 16px;
        margin: 24px 0;
    }
    
    .author-box__dates {
        gap: 8px;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .share-btn {
        padding: 8px 10px;
        min-width: 40px;
        justify-content: center;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .professional-author-box {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
        margin: 20px 0;
        padding: 20px;
    }
    
    .author-box__share,
    .author-box__social {
        display: none; /* Hide interactive elements in print */
    }
    
    .author-avatar-professional {
        width: 60px;
        height: 60px;
    }
    
    .author-box__name {
        font-size: 1.25rem;
    }
    
    .author-box__bio p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Focus states for keyboard navigation */
.share-btn:focus,
.social-link:focus {
    outline: 2px solid #52B880;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .professional-author-box {
        border: 2px solid #000;
    }
    
    .share-btn,
    .social-link {
        border-width: 2px;
    }
    
    .author-box__dates {
        border-left-width: 6px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .author-avatar-professional,
    .share-btn,
    .social-link {
        transition: none;
    }
    
    .share-btn:hover,
    .social-link:hover {
        transform: none;
    }
}

/* ===== LOADING STATES ===== */

.professional-author-box.loading {
    opacity: 0.7;
    pointer-events: none;
}

.professional-author-box.loading .author-avatar-professional {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ===== HOVER EFFECTS FOR DESKTOP ===== */

@media (hover: hover) and (pointer: fine) {
    .professional-author-box:hover {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
        transition: all 0.3s ease;
    }
    
    .author-box__header:hover .author-avatar-professional {
        transform: scale(1.05);
    }
}

/* ===== ANIMATION ENHANCEMENTS ===== */

.professional-author-box {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Staggered animation for child elements */
.author-box__header {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.author-box__bio {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.author-box__dates {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.author-box__share {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.author-box__social {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

/* Disable animations on reduced motion */
@media (prefers-reduced-motion: reduce) {
    .professional-author-box,
    .author-box__header,
    .author-box__bio,
    .author-box__dates,
    .author-box__share,
    .author-box__social {
        animation: none;
    }
}



/* ===== ENHANCED MOBILE OPTIMIZATIONS ===== */

/* Touch-friendly improvements */
@media (max-width: 768px) {
    /* Ensure all interactive elements are at least 44px for touch */
    .share-btn,
    .social-link {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improve spacing for touch targets */
    .share-buttons {
        gap: 12px;
        margin: 16px 0;
    }
    
    .social-links {
        gap: 12px;
        margin: 16px 0;
    }
    
    /* Better text readability on mobile */
    .author-box__bio p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 20px;
    }
    
    /* Optimize dates layout for mobile */
    .author-box__dates {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .date-item {
        align-items: center;
        text-align: center;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    /* Stack share buttons vertically on very small screens */
    .share-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .share-btn span {
        display: inline; /* Show text on full-width buttons */
    }
    
    /* Optimize social links for small screens */
    .social-links {
        justify-content: space-between;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 8px 0;
        gap: 8px;
    }
    
    .social-link {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Improve avatar sizing */
    .author-avatar-professional {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    /* Better typography hierarchy */
    .author-box__name {
        font-size: 1.75rem;
        text-align: center;
    }
    
    .author-box__title,
    .author-box__company {
        text-align: center;
    }
}

/* Extra small screens optimization */
@media (max-width: 360px) {
    .professional-author-box {
        margin: 20px -10px; /* Extend to screen edges with small margin */
        border-radius: 8px;
        padding: 20px 16px;
    }
    
    .author-box__header {
        gap: 12px;
    }
    
    .author-avatar-professional {
        width: 80px;
        height: 80px;
    }
    
    .author-box__name {
        font-size: 1.5rem;
    }
    
    .share-btn {
        font-size: 0.875rem;
        padding: 10px 12px;
    }
    
    .social-link {
        font-size: 0.8125rem;
        padding: 8px 10px;
    }
}

/* ===== LANDSCAPE MOBILE OPTIMIZATION ===== */

@media (max-width: 768px) and (orientation: landscape) {
    .author-box__header {
        flex-direction: row;
        text-align: left;
    }
    
    .author-avatar-professional {
        width: 80px;
        height: 80px;
    }
    
    .author-box__dates {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .share-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .share-btn {
        width: auto;
        min-width: 120px;
    }
}

/* ===== TABLET SPECIFIC OPTIMIZATIONS ===== */

@media (min-width: 481px) and (max-width: 768px) {
    .professional-author-box {
        padding: 36px 28px;
    }
    
    .author-box__header {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }
    
    .author-avatar-professional {
        width: 100px;
        height: 100px;
    }
    
    .share-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .social-links {
        justify-content: flex-start;
        gap: 16px;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Reduce animations on low-end devices */
@media (max-width: 480px) {
    .professional-author-box,
    .author-box__header,
    .author-box__bio,
    .author-box__dates,
    .author-box__share,
    .author-box__social {
        animation-duration: 0.3s;
    }
    
    .share-btn:hover,
    .social-link:hover {
        transform: none; /* Disable transform on mobile for better performance */
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS FOR MOBILE ===== */

/* Larger focus indicators on mobile */
@media (max-width: 768px) {
    .share-btn:focus,
    .social-link:focus {
        outline: 3px solid #52B880;
        outline-offset: 3px;
    }
}

/* High contrast improvements for mobile */
@media (max-width: 768px) and (prefers-contrast: high) {
    .professional-author-box {
        border: 3px solid #000;
    }
    
    .share-btn,
    .social-link {
        border-width: 2px;
        font-weight: 700;
    }
    
    .author-box__dates {
        border-left-width: 8px;
    }
}

/* ===== LOADING STATES FOR MOBILE ===== */

@media (max-width: 768px) {
    .professional-author-box.loading .share-btn,
    .professional-author-box.loading .social-link {
        opacity: 0.5;
        pointer-events: none;
    }
    
    .professional-author-box.loading .author-box__bio {
        animation: shimmer 1.5s ease-in-out infinite;
    }
    
    @keyframes shimmer {
        0% { opacity: 1; }
        50% { opacity: 0.7; }
        100% { opacity: 1; }
    }
}

/* ===== SAFE AREA SUPPORT FOR NOTCHED DEVICES ===== */

@supports (padding: max(0px)) {
    @media (max-width: 480px) {
        .professional-author-box {
            padding-left: max(20px, env(safe-area-inset-left));
            padding-right: max(20px, env(safe-area-inset-right));
        }
    }
}

/* ===== IMPROVED TOUCH FEEDBACK ===== */

@media (max-width: 768px) {
    .share-btn:active,
    .social-link:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Visual feedback for successful copy action */
    .share-btn--copy.copied {
        background: #52B880 !important;
        color: white !important;
        border-color: #52B880 !important;
    }
    
    .share-btn--copy.copied::after {
        content: '✓';
        margin-left: 8px;
    }
}

/* ===== CONTENT OPTIMIZATION FOR MOBILE ===== */

@media (max-width: 480px) {
    /* Shorter bio text on very small screens */
    .author-box__bio p:nth-child(2) {
        display: none; /* Hide second paragraph on very small screens */
    }
    
    /* Simplified date display */
    .date-label {
        font-size: 0.75rem;
    }
    
    .date-value {
        font-size: 0.875rem;
    }
    
    /* Compact social section */
    .social-title {
        font-size: 0.875rem;
        margin-bottom: 12px;
    }
}

/* ===== PROGRESSIVE ENHANCEMENT ===== */

/* Enhanced features for devices with hover capability */
@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
    .share-btn {
        position: relative;
        overflow: hidden;
    }
    
    .share-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s ease;
    }
    
    .share-btn:hover::before {
        left: 100%;
    }
}

/* ===== PRINT OPTIMIZATION FOR MOBILE ===== */

@media print {
    .professional-author-box {
        padding: 15px;
        margin: 15px 0;
        page-break-inside: avoid;
    }
    
    .author-box__header {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    .author-avatar-professional {
        width: 50px;
        height: 50px;
    }
    
    .author-box__name {
        font-size: 1.125rem;
    }
    
    .author-box__bio p {
        font-size: 0.8125rem;
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    .author-box__dates {
        flex-direction: row;
        gap: 20px;
        padding: 10px;
        margin: 10px 0;
    }
}

