/* Companies Visual Page Styles */
.companies-visual-section {
    padding: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

.companies-visual-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header Section */
.visual-header {
    text-align: center;
    margin-bottom: 60px;
    background: var(--primary-color);
    color: var(--white);
    padding: 20px;
    border-radius: 8px;
}

.visual-header h2 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.visual-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 3px;
}

/* Main Diagram Container */
.diagram-container {
    position: relative;
    width: 100%;
    height: 90vh;
    min-height: 700px;
    max-height: 1000px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 4vw;
    overflow: visible;
}

/* Construction Visual */
.construction-visual {
    position: absolute;
    top: 3vh;
    left: 3vw;
    z-index: 5;
}

.construction-visual img {
    width: min(33vw, 535px);
    height: auto;
    object-fit: contain;
}

/* Central Logo */
.central-logo {
    position: absolute;
    top: 60vh;
    left: 12.5vw;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.logo-circle {
    width: 160px;
    height: 160px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--secondary-color);
}

.logo-content {
    text-align: center;
}

.logo-m {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: -8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mcelligott {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.8px;
}

.holdings {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--secondary-color);
    letter-spacing: 0.8px;
}

/* Company Nodes */
.company-node {
    position: absolute;
}

.company-number {
    position: absolute;
    width: 45px;
    height: 45px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    z-index: 15;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Company Lines */
.company-line {
    position: absolute;
    background: var(--secondary-color);
    z-index: 5;
    height: 3px;
}

/* Company 01 - Kerry Group (Top Right) */
.company-01 {
    top: 8vh;
    right: 1.5vw;
}

.company-01 .company-number {
    top: 8vh;
    left: -17vw;
}

.line-01 {
    width: 12vw;
    top: calc(8vh + 22px);
    left: -27vw;
    transform: none;
    transform-origin: none;
}

.company-01 .company-card {
    width: min(46vw, 640px);
    height: 180px;
    background: #8FBC8F;
    border-radius: 25px;
    padding: 18px;
    color: var(--white);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-left: 0;
}

/* Company 02 - GSCE (Middle Right) */
.company-02 {
    top: 50%;
    right: 1.5vw;
    transform: translateY(-50%);
}

.company-02 .company-number {
    top: 50%;
    left: -4.5vw;
    transform: translateY(-50%);
}

.line-02 {
    width: 10vw;
    top: 50%;
    left: -14.5vw;
    transform: translateY(-50%);
}

.company-02 .company-card {
    width: min(46vw, 640px);
    height: 180px;
    background: #2F4F4F;
    border-radius: 25px;
    padding: 18px;
    color: var(--white);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Company 03 - GSCE Modular (Bottom Right) */
.company-03 {
    bottom: 8vh;
    right: 1.5vw;
}

.company-03 .company-number {
    bottom: 8vh;
    left: -4.5vw;
}

.line-03 {
    width: 11vw;
    bottom: calc(8vh + 22px);
    left: -15.5vw;
    transform: rotate(-25deg);
    transform-origin: right center;
}

.company-03 .company-card {
    width: min(46vw, 640px);
    height: 180px;
    background: #228B22;
    border-radius: 25px;
    padding: 18px;
    color: var(--white);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Company Card Styles */
.company-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.company-logo-circle {
    width: 70px;
    height: 70px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    margin-top: 5px;
}

.company-info {
    flex: 1;
}

.company-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.2;
}

.company-info p {
    font-size: 0.85rem;
    line-height: 1.3;
    opacity: 0.95;
}

/* Company Logo Icons */
.kerry-logo,
.gsce-logo,
.modular-logo {
    text-align: center;
    color: var(--primary-color);
}

.building-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 4px;
}

.building-line {
    width: 20px;
    height: 3px;
    background: var(--primary-color);
}

.leaf-icon i {
    font-size: 1.5rem;
    color: #228B22;
    margin-bottom: 4px;
}

.modular-icon {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.module-block {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 1px;
}

.company-name-small {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    display: block;
}

/* Footer */
.visual-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
}

.visual-footer p {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .company-card {
        width: min(28vw, 300px);
    }
    
    .company-01 .company-card {
        width: min(56vw, 600px);
        height: 170px;
    }
    
    .company-02 .company-card {
        width: min(56vw, 600px);
        height: 170px;
    }
    
    .company-03 .company-card {
        width: min(56vw, 600px);
        height: 170px;
        border-radius: 50px;

    }
    
    .construction-visual img {
        width: min(29vw, 465px);
    }
    
    .central-logo {
        top: 58vh;
        left: 34vw;
    }
}

@media (max-width: 1200px) {
    .diagram-container {
        height: 85vh;
        min-height: 600px;
        padding: 3vw;
    }
    
    .central-logo {
        top: 56vh;
        left: 16vw;
    }
    
    .company-card {
        width: min(32vw, 280px);
       
    }
    
    .company-01 .company-card {
        width: min(64vw, 560px);
        height: 160px;
        border-radius: 70px;
    }
    
    .company-02 .company-card {
        width: min(64vw, 560px);
        height: 160px;
        border-radius: 70px;
    }
    
    .company-03 .company-card {
        width: min(64vw, 560px);
        height: 160px;
        border-radius: 70px;
    }
    
    .company-info h3 {
        font-size: 1.1rem;
    }
    
    .company-info p {
        font-size: 0.8rem;
    }
    
    .construction-visual img {
        width: min(27vw, 400px);
    }
    
    .line-01, .line-02, .line-03 {
        width: 8vw;
    }
    
    .company-01 .line-01 {
        width: 10vw;
        left: -22vw;
    }
    
    .company-01 .company-number {
        left: -14vw;
    }
}

@media (max-width: 992px) {
    .diagram-container {
        height: 80vh;
        min-height: 550px;
    }
    
    .central-logo {
        top: 54vh;
        left: 50vw;
    }
    
    .construction-visual img {
        width: min(24vw, 335px);
    }
    
    .company-card {
        width: min(38vw, 250px);
        padding: 15px;
    }
    
    .company-01 .company-card {
        width: min(76vw, 500px);
        height: 140px;
    }
    
    .company-02 .company-card {
        width: min(76vw, 500px);
        height: 140px;
    }
    
    .company-03 .company-card {
        width: min(76vw, 500px);
        height: 140px;
    }
    
    .logo-circle {
        width: 140px;
        height: 140px;
        border: 5px solid var(--secondary-color);
    }
    
    .logo-m {
        font-size: 3rem;
    }
    
    .company-info h3 {
        font-size: 1rem;
    }
    
    .company-info p {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .visual-header h1 {
        font-size: 2rem;
    }
    
    .visual-header h2 {
        font-size: 0.8rem;
    }
    
    .diagram-container {
        height: auto;
        min-height: auto;
        padding: 30px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    
    .construction-visual {
        position: static;
        order: 1;
        align-self: flex-start;
    }
    
    .construction-visual img {
        width: min(67vw, 270px);
    }
    
    .central-logo {
        position: static;
        transform: none;
        order: 2;
    }
    
    .logo-circle {
        width: 120px;
        height: 120px;
    }
    
    .logo-m {
        font-size: 2.5rem;
    }
    
    .mcelligott {
        font-size: 0.7rem;
    }
    
    .holdings {
        font-size: 0.5rem;
    }
    
    .company-01, .company-02, .company-03 {
        position: static;
        order: 3;
        width: 100%;
        max-width: 350px;
    }
    
    .company-number {
        position: static;
        margin-bottom: 15px;
        align-self: flex-start;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .company-line {
        display: none;
    }
    
    .company-card {
        width: 100% !important;
        max-width: 100%;
        padding: 20px;
        margin-top: 10px;
        margin-left: 0 !important;
    }
    
    .company-logo-circle {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .companies-visual-container {
        padding: 20px 10px;
    }
    
    .diagram-container {
        padding: 20px 15px;
        gap: 30px;
    }
    
    .logo-circle {
        width: 120px;
        height: 120px;
    }
    
    .logo-m {
        font-size: 2.5rem;
    }
    
    .company-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px 15px;
    }
    
    .company-logo-circle {
        margin: 0 auto;
    }
    
    .company-number {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
        margin: 0 auto 10px;
    }
}
