/**
 * WP Mirror Hub Public Styles
 * 
 * Frontend styles for shortcodes and blocks
 */

/* ==========================================================================
   VIP Lines Styles
   ========================================================================== */

.mh-vip-lines {
    margin: 20px 0;
    padding: 0;
}

.mh-vip-lines.style-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mh-vip-lines.style-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.mh-vip-line {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    overflow: hidden;
}

.mh-vip-line:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    text-decoration: none;
}

.mh-vip-line:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mh-vip-line:hover:before {
    left: 100%;
}

.mh-vip-line-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.mh-vip-line-icon {
    font-size: 24px;
    color: #ffd700;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.mh-vip-line-text {
    flex: 1;
}

.mh-vip-line-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.mh-vip-line-latency {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mh-latency-dot {
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mh-vip-line-arrow {
    font-size: 18px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.mh-vip-line:hover .mh-vip-line-arrow {
    transform: translateX(5px);
}

/* Alternative colors for different lines */
.mh-vip-line:nth-child(1) { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.mh-vip-line:nth-child(2) { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.mh-vip-line:nth-child(3) { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.mh-vip-line:nth-child(4) { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.mh-vip-line:nth-child(5) { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.mh-vip-line:nth-child(6) { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }

/* ==========================================================================
   Game Grid Styles
   ========================================================================== */

.mh-game-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.mh-game-grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.mh-game-grid.cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mh-game-grid.cols-6 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.mh-game-item {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.mh-game-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.mh-game-image {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

.mh-game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mh-game-item:hover .mh-game-image img {
    transform: scale(1.1);
}

.mh-game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mh-game-item:hover .mh-game-overlay {
    opacity: 1;
}

.mh-game-play-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mh-game-play-btn:hover {
    background: #764ba2;
    transform: scale(1.05);
}

.mh-game-name {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    background: #ffffff;
}

.mh-game-item.no-names .mh-game-name {
    display: none;
}

.mh-game-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 48px;
}

/* ==========================================================================
   Counter Styles
   ========================================================================== */

.mh-counter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 25px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mh-counter-icon {
    font-size: 18px;
    color: #ffd700;
}

.mh-counter-text {
    font-size: 14px;
    margin-right: 8px;
}

.mh-counter-number {
    font-size: 18px;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    display: inline-block;
    min-width: 120px;
    text-align: right;
}

.mh-counter-digit {
    display: inline-block;
    position: relative;
    overflow: hidden;
    height: 1.2em;
    width: 0.8em;
    text-align: center;
}

.mh-counter-digit-inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transition: transform 0.5s ease;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .mh-vip-lines.style-buttons {
        grid-template-columns: 1fr;
    }
    
    .mh-vip-line {
        padding: 12px 15px;
    }
    
    .mh-vip-line-title {
        font-size: 14px;
    }
    
    .mh-game-grid {
        gap: 15px;
    }
    
    .mh-game-grid.cols-3,
    .mh-game-grid.cols-4,
    .mh-game-grid.cols-6 {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .mh-game-image {
        height: 120px;
    }
    
    .mh-counter {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .mh-counter-number {
        min-width: 100px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .mh-vip-line-content {
        gap: 10px;
    }
    
    .mh-vip-line-icon {
        font-size: 20px;
    }
    
    .mh-game-grid.cols-3,
    .mh-game-grid.cols-4,
    .mh-game-grid.cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mh-game-image {
        height: 100px;
    }
    
    .mh-game-name {
        padding: 10px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .mh-game-item {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .mh-game-name {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .mh-game-image {
        background: linear-gradient(45deg, #3a3a3a, #2a2a2a);
    }
    
    .mh-game-placeholder {
        color: #666;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.mh-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mh-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.mh-vip-line:focus,
.mh-game-item:focus,
.mh-game-play-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .mh-vip-line,
    .mh-game-item,
    .mh-game-image img,
    .mh-counter-digit-inner {
        transition: none;
    }
    
    .mh-latency-dot {
        animation: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .mh-vip-lines,
    .mh-game-grid,
    .mh-counter {
        box-shadow: none !important;
        background: transparent !important;
        color: #000 !important;
    }
    
    .mh-vip-line,
    .mh-game-item {
        border: 1px solid #000 !important;
        background: transparent !important;
    }
}
