/* Glowing Card Hover Component - EXACT implementation from glowing-card-hover.md */

/* Container */
.glowing-cards-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grid Layout - EXACT from React component */
.glowing-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 1200px;
    width: 100%;
}

@media (min-width: 768px) {
    .glowing-grid {
        grid-template-columns: repeat(12, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .glowing-grid {
        gap: 1rem;
        max-height: 34rem;
        grid-template-rows: repeat(2, 1fr);
    }
}

/* Grid Areas - EXACT from React component */
.area-1 {
    grid-area: 1 / 1 / 2 / -1;
}

.area-2 {
    grid-area: 2 / 1 / 3 / -1;
}

.area-3 {
    grid-area: 3 / 1 / 4 / -1;
}

.area-4 {
    grid-area: 4 / 1 / 5 / -1;
}

.area-5 {
    grid-area: 5 / 1 / 6 / -1;
}

@media (min-width: 768px) {
    .area-1 {
        grid-area: 1 / 1 / 2 / 7;
    }
    
    .area-2 {
        grid-area: 1 / 7 / 2 / 13;
    }
    
    .area-3 {
        grid-area: 2 / 1 / 3 / 7;
    }
    
    .area-4 {
        grid-area: 2 / 7 / 3 / 13;
    }
    
    .area-5 {
        grid-area: 3 / 1 / 4 / 13;
    }
}

@media (min-width: 1024px) {
    .area-1 {
        grid-area: 1 / 1 / 2 / 5;
    }
    
    .area-2 {
        grid-area: 2 / 1 / 3 / 5;
    }
    
    .area-3 {
        grid-area: 1 / 5 / 3 / 8;
    }
    
    .area-4 {
        grid-area: 1 / 8 / 2 / 13;
    }
    
    .area-5 {
        grid-area: 2 / 8 / 3 / 13;
    }
}

/* Grid Item */
.grid-item {
    min-height: 14rem;
    list-style: none;
}

/* Glowing Card - EXACT structure from React component */
.glowing-card {
    position: relative;
    height: 100%;
    border-radius: 1.25rem;
    border: 0.75px solid #374151;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .glowing-card {
        border-radius: 1.5rem;
        padding: 0.75rem;
    }
}

/* Glowing Effect - EXACT implementation from React GlowingEffect component */
.glowing-effect {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 1;
    transition: opacity 0.3s;
    pointer-events: none;
    
    /* CSS Custom Properties for dynamic values */
    --blur: 0px;
    --spread: 40;
    --start: 0;
    --active: 0;
    --border-width: 3px;
    --repeating-conic-gradient-times: 5;
    
    /* Complex gradient - EXACT from React component */
    --gradient: radial-gradient(circle, #dd7bbb 10%, #dd7bbb00 20%),
                radial-gradient(circle at 40% 40%, #d79f1e 5%, #d79f1e00 15%),
                radial-gradient(circle at 60% 60%, #5a922c 10%, #5a922c00 20%), 
                radial-gradient(circle at 40% 60%, #4c7894 10%, #4c789400 20%),
                repeating-conic-gradient(
                  from 236.84deg at 50% 50%,
                  #dd7bbb 0%,
                  #d79f1e calc(25% / var(--repeating-conic-gradient-times)),
                  #5a922c calc(50% / var(--repeating-conic-gradient-times)), 
                  #4c7894 calc(75% / var(--repeating-conic-gradient-times)),
                  #dd7bbb calc(100% / var(--repeating-conic-gradient-times))
                );
}

/* Glow Effect Inner Element */
.glowing-effect::after {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--border-width));
    border-radius: inherit;
    border: var(--border-width) solid transparent;
    background: var(--gradient);
    background-attachment: fixed;
    opacity: var(--active);
    transition: opacity 0.3s;
    mask-clip: padding-box, border-box;
    mask-composite: intersect;
    mask-image: linear-gradient(transparent, transparent),
                 conic-gradient(from calc((var(--start) - var(--spread)) * 1deg),
                               transparent 0deg,
                               white,
                               transparent calc(var(--spread) * 2deg));
}

/* Card Content */
.card-content {
    position: relative;
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 0.75px solid #374151;
    background: #111827;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    .card-content {
        padding: 1.5rem;
    }
}

/* Card Icon */
.card-icon {
    width: fit-content;
    border-radius: 0.5rem;
    border: 0.75px solid #374151;
    background: #1f2937;
    padding: 0.5rem;
}

.card-icon i {
    font-size: 1rem;
    color: #9ca3af;
}

/* Card Text */
.card-text {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-text h3 {
    font-size: 1.25rem;
    line-height: 1.375rem;
    font-weight: 600;
    font-family: system-ui, -apple-system, sans-serif;
    letter-spacing: -0.04em;
    color: white;
    margin: 0;
    text-balance: balance;
}

@media (min-width: 768px) {
    .card-text h3 {
        font-size: 1.5rem;
        line-height: 1.875rem;
    }
}

.card-text p {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
    line-height: 1.125rem;
    color: #9ca3af;
    margin: 0;
}

@media (min-width: 768px) {
    .card-text p {
        font-size: 1rem;
        line-height: 1.375rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .glowing-cards-container {
        background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    }
    
    .card-content {
        background: #111827;
        border-color: #374151;
    }
    
    .card-icon {
        background: #1f2937;
        border-color: #374151;
    }
    
    .card-text h3 {
        color: white;
    }
    
    .card-text p {
        color: #9ca3af;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .glowing-cards-container {
        padding: 1rem;
    }
    
    .glowing-grid {
        gap: 0.75rem;
    }
    
    .grid-item {
        min-height: 12rem;
    }
    
    .card-content {
        padding: 1rem;
        gap: 1rem;
    }
    
    .card-text h3 {
        font-size: 1.125rem;
    }
    
    .card-text p {
        font-size: 0.8rem;
    }
}
