/* WordPress Org Chart Plugin - Frontend Styles */

#inteorch-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.inteorch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.company-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.company-selector label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.company-selector select {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
    min-width: 200px;
}

.search-container input {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 250px;
}

.search-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Content Section */
.inteorch-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 400px;
}

/* Tree Structure */
.inteorch-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
}

/* Node Container */
.inteorch-node-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Individual Node */
.inteorch-node {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    min-width: 200px;
    max-width: 250px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.inteorch-node:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.inteorch-node.highlighted {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Node Headshot */
.node-headshot {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-headshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.fallback-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #64748b;
    background: #f1f5f9;
}

/* Node Info */
.node-info {
    text-align: center;
}

.node-name {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
}

.node-role {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.3;
}

.node-team-size {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
    padding: 0.25rem 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
}

/* Children Container */
.children-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
    position: relative;
}

.connector-line {
    width: 2px;
    height: 1rem;
    background: #cbd5e1;
    margin-bottom: 1rem;
}

.children-nodes {
    display: flex;
    gap: 2rem;
    position: relative;
}

.child-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.child-connector {
    position: absolute;
    top: 50%;
    left: -1rem;
    width: 2rem;
    height: 2px;
    background: #cbd5e1;
    transform: translateY(-50%);
}

/* Node Details Overlay */
.node-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: flex-end;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.node-details-sidebar {
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.details-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
}

.close-button:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.details-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.details-headshot {
    text-align: center;
    margin-bottom: 1.5rem;
}

.details-headshot img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
}

.fallback-avatar-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    border: 4px solid #e2e8f0;
    margin: 0 auto;
}

.details-basic-info {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.details-name {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
}

.details-role {
    margin: 0 0 0.5rem 0;
    color: #64748b;
    font-size: 1.1rem;
}

.details-id {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
    font-family: monospace;
}

.details-section {
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.section-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
}

.section-content {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.linkedin-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0077b5;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.linkedin-button:hover {
    background: #005885;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.team-member-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.fallback-avatar-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #64748b;
    background: #f1f5f9;
}

.team-member-info {
    flex: 1;
}

.team-member-name {
    margin: 0 0 0.25rem 0;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 500;
}

.team-member-role {
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
}

/* Status Messages */
.no-companies,
.no-data,
.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    font-size: 1.1rem;
    text-align: center;
}

.error-message {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #inteorch-container {
        padding: 10px;
    }
    
    .inteorch-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .company-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .company-selector select,
    .search-container input {
        min-width: auto;
        width: 100%;
    }
    
    .inteorch-tree {
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .inteorch-node {
        min-width: 160px;
        max-width: 200px;
        padding: 0.75rem;
    }
    
    .node-headshot {
        width: 50px;
        height: 50px;
        margin-bottom: 0.5rem;
    }
    
    .node-name {
        font-size: 0.9rem;
    }
    
    .node-role {
        font-size: 0.8rem;
    }
    
    .children-nodes {
        gap: 1rem;
    }
    
    .child-connector {
        left: -0.5rem;
        width: 1rem;
    }
    
    .node-details-sidebar {
        width: 100vw;
        max-width: 100vw;
    }
    
    .details-header {
        padding: 1rem;
    }
    
    .details-content {
        padding: 1rem;
    }
    
    .details-headshot img,
    .fallback-avatar-large {
        width: 100px;
        height: 100px;
    }
    
    .details-name {
        font-size: 1.3rem;
    }
    
    .details-role {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .children-nodes {
        flex-direction: column;
        gap: 1rem;
    }
    
    .child-connector {
        display: none;
    }
}
