/**
 * Connector Threading System Styles
 * Weaves connector insights throughout all platform sections
 */

/* Story Connector Insights */
.connector-story-insight {
    background: rgba(126, 93, 76, 0.05);
    border-left: 4px solid var(--primary-brown);
    border-radius: 0 12px 12px 0;
    padding: 1.5rem;
    margin: 2rem 0;
    position: relative;
    transition: all 0.3s ease;
}

.connector-story-insight:hover {
    background: rgba(126, 93, 76, 0.08);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(126, 93, 76, 0.15);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.connector-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-green);
    flex-shrink: 0;
}

.connector-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.connector-attribution {
    flex: 1;
}

.connector-name {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.connector-context {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.insight-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-brown);
}

.insight-content {
    margin: 1.5rem 0;
}

.local-perspective {
    margin-bottom: 1rem;
}

.local-perspective p {
    font-style: italic;
    color: var(--text-medium);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
    position: relative;
}

.local-perspective p::before {
    content: '"';
    font-size: 3rem;
    color: var(--accent-green);
    position: absolute;
    left: -1.5rem;
    top: -1rem;
    font-family: 'Playfair Display', serif;
}

.cultural-context {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.context-label {
    color: var(--text-light);
    font-weight: 600;
}

.context-value {
    color: var(--primary-brown);
    font-weight: 600;
    background: rgba(126, 93, 76, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.insight-actions {
    margin-top: 1.5rem;
}

.expand-connector-btn {
    background: var(--primary-brown);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.expand-connector-btn:hover {
    background: var(--secondary-tan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(126, 93, 76, 0.3);
}

/* Product Connector Insights */
.product-connector-insights {
    background: var(--background-light);
    padding: 2rem;
    border-radius: 16px;
    margin: 2rem 0;
}

.product-connector-insights h4 {
    color: var(--primary-brown);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.connector-product-insight {
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.connector-product-insight:hover {
    border-color: var(--accent-green);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.connector-profile-mini {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--background-light);
}

.connector-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-green);
    flex-shrink: 0;
}

.connector-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.connector-info h5 {
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.connector-role,
.connector-location {
    color: var(--text-light);
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

.connector-contribution {
    display: grid;
    gap: 1.5rem;
}

.connection-story,
.brewing-wisdom,
.impact-connection {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 8px;
}

.connection-story h6,
.brewing-wisdom h6,
.impact-connection h6 {
    color: var(--primary-brown);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.brewing-method {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-green);
}

.method-name {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.method-description {
    color: var(--text-medium);
    line-height: 1.5;
    margin: 0;
}

.connector-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.view-profile-btn,
.support-connector-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.view-profile-btn {
    background: var(--primary-brown);
    color: white;
}

.view-profile-btn:hover {
    background: var(--secondary-tan);
    color: white;
    transform: translateY(-2px);
}

.support-connector-btn {
    background: var(--accent-green);
    color: var(--text-dark);
}

.support-connector-btn:hover {
    background: #B0BC5A;
    transform: translateY(-2px);
}

/* Research Connector Contributions */
.research-connector-contributions {
    background: rgba(201, 204, 104, 0.05);
    border: 2px solid var(--accent-green);
    border-radius: 16px;
    padding: 2rem;
    margin: 3rem 0;
}

.research-connector-contributions h4 {
    color: var(--primary-brown);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.connector-research-contribution {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--accent-green);
}

.contributor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contributor-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-green);
    flex-shrink: 0;
}

.contributor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contributor-info h6 {
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.contributor-role,
.contributor-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.contribution-details {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.research-contributions,
.local-knowledge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.contribution-type,
.knowledge-label {
    color: var(--text-light);
    font-weight: 600;
    min-width: 120px;
}

.contribution-value,
.knowledge-value {
    color: var(--primary-brown);
    font-weight: 600;
    background: rgba(126, 93, 76, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.contributor-actions {
    text-align: right;
}

.view-contributor-profile {
    color: var(--primary-brown);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.view-contributor-profile:hover {
    text-decoration: underline;
}

/* Connector Quotes */
.connector-quote {
    background: var(--background-light);
    border: none;
    border-left: 6px solid var(--accent-green);
    border-radius: 0 12px 12px 0;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    font-style: normal;
}

.connector-quote.default {
    /* Default quote style */
}

.connector-quote.emphasized {
    background: rgba(201, 204, 104, 0.1);
    border-left-color: var(--primary-brown);
}

.connector-quote.minimal {
    background: transparent;
    border-left: 3px solid var(--accent-green);
    padding: 1rem 0 1rem 2rem;
}

.quote-content p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-medium);
    font-style: italic;
    margin: 0;
    position: relative;
}

.quote-content p::before {
    content: '"';
    font-size: 4rem;
    color: var(--accent-green);
    position: absolute;
    left: -2rem;
    top: -1.5rem;
    font-family: 'Playfair Display', serif;
    opacity: 0.7;
}

.quote-attribution {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(102, 102, 102, 0.2);
}

.connector-citation {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.connector-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.connector-context,
.connector-location {
    color: var(--text-light);
    font-size: 0.85rem;
}

.connector-avatar-quote {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-green);
    flex-shrink: 0;
}

.connector-avatar-quote img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Connector Detail Modal */
.connector-detail-modal {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    background: var(--primary-brown);
    color: white;
    padding: 2rem;
    position: relative;
}

.connector-profile-header {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.connector-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    flex-shrink: 0;
}

.connector-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.connector-intro h3 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.connector-intro p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0.25rem 0;
}

.connector-languages .label {
    font-weight: 600;
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-content {
    padding: 2rem;
}

.connection-story-section,
.local-insights-section,
.brewing-wisdom-section,
.community-projects-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--background-light);
}

.connection-story-section:last-child,
.local-insights-section:last-child,
.brewing-wisdom-section:last-child,
.community-projects-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-content h4 {
    color: var(--primary-brown);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.insights-grid,
.methods-list,
.projects-list {
    display: grid;
    gap: 1rem;
}

.insight-item,
.method-item,
.project-item {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 8px;
}

.insight-item h5,
.method-item h5,
.project-item h5 {
    color: var(--text-dark);
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}

.cultural-significance {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(102, 102, 102, 0.2);
    color: var(--text-light);
    font-size: 0.9rem;
}

.modal-actions {
    padding: 2rem;
    background: var(--background-light);
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.view-full-profile-btn,
.support-connector-modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.view-full-profile-btn {
    background: var(--primary-brown);
    color: white;
}

.view-full-profile-btn:hover {
    background: var(--secondary-tan);
    color: white;
}

.support-connector-modal-btn {
    background: var(--accent-green);
    color: var(--text-dark);
}

.support-connector-modal-btn:hover {
    background: #B0BC5A;
}

/* Modal Overlay */
.connector-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

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

.connector-modal-overlay .connector-detail-modal {
    animation: slideUp 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .connector-story-insight {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .insight-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .connector-profile-mini {
        flex-direction: column;
        text-align: center;
    }
    
    .connector-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .connector-profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .quote-attribution {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .connector-detail-modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .insight-type {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    .local-perspective p::before {
        left: -1rem;
        top: -0.5rem;
        font-size: 2rem;
    }
    
    .connector-contribution {
        gap: 1rem;
    }
    
    .contribution-details {
        gap: 0.5rem;
    }
    
    .research-contributions,
    .local-knowledge {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .contribution-type,
    .knowledge-label {
        min-width: auto;
    }
}

/* Print Styles */
@media print {
    .connector-story-insight,
    .connector-product-insight,
    .connector-research-contribution {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
    
    .expand-connector-btn,
    .support-connector-btn,
    .view-profile-btn,
    .modal-actions {
        display: none;
    }
    
    .connector-quote {
        background: #f9f9f9 !important;
        border-left: 3px solid #000 !important;
    }
}