/* GD&T Section Styles */
#symbols-guidelines {
    padding-top: 0;
}

.gdt-part-container {
    width: 100%;
    padding: 2rem;
    /* Black background to match logo colors */
    background: #0b0b0e;
    border-radius: 24px;
    /* Red accent border */
    border: 1px solid rgba(220, 38, 38, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.gdt-part-title {
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    font-size: 28px;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: 2px;
}

/* 4-column Grid layout matching the 'gdt-symbols' interface */
.grid-columns-g20 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
}
@media(min-width: 600px) {
    .grid-columns-g20 { grid-template-columns: repeat(2, 1fr); }
}
@media(min-width: 900px) {
    .grid-columns-g20 { grid-template-columns: repeat(3, 1fr); }
}
@media(min-width: 1200px) {
    .grid-columns-g20 { grid-template-columns: repeat(4, 1fr); }
    /* Override for GD&T specifically to fit 15 items per row */
    #symbols-guidelines .grid-columns-g20 { 
        grid-template-columns: repeat(15, 1fr); 
        gap: 8px; 
    }
}

/* Base card styling */
.col-3 {
    display: block;
    background: #15151a;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    text-decoration: none;
    text-align: left;
}

/* Base icon sizing matching their original layout */
.w-mx-160px {
    max-width: 120px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    filter: invert(1) drop-shadow(0px 2px 4px rgba(0,0,0,0.8)); /* Making original black/blue svgs white for dark UI! */
}

.card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.grid-cell-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    line-height: 1.3;
}

.grid-cell-title a {
    color: #ffffff;
    text-decoration: none;
}

.card-details-description {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 20px;
}

.card-details p:last-child a {
    color: #ef4444;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

/* Red accents on hover */
.col-3:hover {
    transform: translateY(-5px);
    border-color: #ef4444;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15);
}

.col-3:hover .card-details p:last-child a {
    color: #f87171;
}

/* Density overrides for the 9-column GD&T grid on large screens */
@media(min-width: 1200px) {
    #symbols-guidelines .col-3 { 
        padding: 0px !important; 
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        aspect-ratio: 1 / 1;
        overflow: hidden;
    }
    
    #symbols-guidelines .card {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #symbols-guidelines .w-mx-160px { 
        width: 100%;
        max-width: 100% !important; 
        height: 100%;
        object-fit: cover;
        margin: 0 !important; 
        border-radius: 12px;
    }
}

/* Hide text descriptions on GD&T cards to keep them completely clean icon buttons */
#symbols-guidelines .card-details {
    display: none !important;
}


/* Chart Viewer Modal */
#gdt-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
}

#gdt-modal.active {
    display: flex;
}

.gdt-modal-content {
    background: #0b0b0e;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 50px rgba(0,0,0,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: gdtModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gdtModalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.gdt-modal-header {
    padding: 15px 25px;
    background: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.gdt-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 20px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.close-gdt-modal {
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-gdt-modal:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}

.gdt-viewer-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    background: #0b0b0e;
    position: relative;
    overflow: hidden;
}

#gdt-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Base icon sizing matching their original layout */
.w-mx-160px {
    max-width: 120px;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    filter: invert(1) drop-shadow(0px 2px 4px rgba(0,0,0,0.8));
}

/* Scroll lock when modal is open */
body.gdt-modal-open {
    overflow: hidden !important;
}
