/**
 * LEGO Brick Loading Animation Styles
 * EXACT MATCH to portfolio page brick characteristics
 */

.lego-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lego-loading-bricks {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    flex-wrap: nowrap !important;
    margin: 16px 0;
    padding: 12px 4px 20px 4px; /* Start with mobile padding */
    background: #2c3e50;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    min-height: 50px; /* Start small */
    overflow: hidden;
}

.lego-loading-brick {
    /* EXACT MATCH: SIZE FOR SMALLEST SCREENS FIRST (320px) */
    width: 20px !important;  /* Exact mobile size from portfolio */
    height: 26px !important; /* Maintains 40:52 ratio from portfolio */
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    margin-top: 3px;
    transform-origin: center bottom;
}

.lego-loading-brick:hover {
    transform: scale(1.1) rotateY(10deg); /* EXACT MATCH to portfolio */
}

.lego-loading-brick .brick-stud {
    width: 9px;  /* EXACT MATCH: Proportional to 20px brick */
    height: 4px;
    border-radius: 1px;
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 1;
}

.lego-loading-brick .brick-body {
    width: 100%;
    height: 26px; /* EXACT MATCH: Same as brick height */
    border-radius: 2px;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 2;
    background: #ecf0f1; /* Empty color from portfolio */
}

.lego-loading-brick .brick-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 4px 4px;
    transition: height 1s ease-out; /* EXACT MATCH: 1s duration from portfolio */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* EXACT RESPONSIVE BREAKPOINTS FROM PORTFOLIO */
@media (min-width: 480px) {
    .lego-loading-brick {
        width: 28px !important;
        height: 36px !important;
    }
    .lego-loading-brick .brick-stud {
        width: 13px;
        height: 6px;
        top: -6px;
    }
    .lego-loading-brick .brick-body {
        height: 36px;
    }
    .lego-loading-bricks {
        padding: 14px 6px 24px 6px;
        min-height: 65px;
    }
}

@media (min-width: 768px) {
    .lego-loading-brick {
        width: 35px !important;
        height: 46px !important;
    }
    .lego-loading-brick .brick-stud {
        width: 16px;
        height: 7px;
        top: -7px;
    }
    .lego-loading-brick .brick-body {
        height: 46px;
    }
    .lego-loading-bricks {
        padding: 18px 10px 30px 10px;
        min-height: 80px;
    }
}

@media (min-width: 1024px) {
    .lego-loading-brick {
        width: 40px !important;
        height: 52px !important;
    }
    .lego-loading-brick .brick-stud {
        width: 18px;
        height: 8px;
        top: -8px;
    }
    .lego-loading-brick .brick-body {
        height: 52px;
    }
    .lego-loading-bricks {
        padding: 24px 16px 40px 16px;
        min-height: 100px;
    }
}

/* Animation keyframes for enhanced effects */
@keyframes brickPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes brickShimmer {
    0%, 100% { 
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    }
    50% { 
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 0 15px rgba(255,255,255,0.5);
    }
}

.lego-loading-brick.filled .brick-fill {
    animation: brickShimmer 2s infinite;
}

.lego-loading-brick.filling {
    animation: brickPulse 1s infinite;
}

/* Color theme variants */
.lego-loading-theme-blue .brick-fill {
    background: linear-gradient(180deg, #0055BF 0%, #1E9AA8 100%);
}

.lego-loading-theme-red .brick-fill {
    background: linear-gradient(180deg, #C91A09 0%, #FE8A18 100%);
}

.lego-loading-theme-green .brick-fill {
    background: linear-gradient(180deg, #237841 0%, #BBE90B 100%);
}

.lego-loading-theme-gold .brick-fill {
    background: linear-gradient(180deg, #ffd700 0%, #f1c40f 50%, #d4af37 100%);
}

/* Loading text animation */
.lego-loading-text {
    animation: textPulse 1.5s infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}