/* Coin Flip - Professional Styles with Distinct Heads/Tails */

.coinflip-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.coinflip-wrapper {
    max-width: 950px;
    margin: 0 auto;
}

.coinflip-title {
    font-size: 3rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.coinflip-icon {
    font-size: 2.8rem;
    display: inline-block;
    animation: spin 2s infinite;
}

@keyframes spin {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
}

.coinflip-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-family: 'Poppins', sans-serif;
}

.coinflip-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* Global Stats */
.global-stats {
    /* background: linear-gradient(135deg, var(--primary-light), var(--primary)); */
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
}

.global-stats h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.global-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.global-stat-card {
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.global-stat-card.heads-bg {
    background: rgba(255, 215, 0, 0.25);
}

.global-stat-card.tails-bg {
    background: rgba(192, 192, 192, 0.25);
}

.global-stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
}

.global-stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-top: 0.3rem;
}

.global-stat-percent {
    font-size: 0.8rem;
    margin-top: 0.2rem;
    font-weight: 600;
}

.global-last-updated {
    text-align: center;
    font-size: 0.7rem;
    margin-top: 1rem;
    opacity: 0.8;
}

/* Personal Stats */
.personal-stats {
    background: var(--bg);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.personal-stats h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.coinflip-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.8rem;
}

.coinflip-stat-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    border: 1px solid var(--border);
}

.coinflip-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Poppins', sans-serif;
}

.coinflip-stat-label {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

.coinflip-stat-percent {
    font-size: 0.65rem;
    color: var(--primary);
    margin-top: 0.2rem;
    font-weight: 600;
}

/* Coin Area */
.coinflip-coin-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    perspective: 1500px;
}

.coin {
    position: relative;
    width: 220px;
    height: 220px;
    cursor: pointer;
    transition: transform 0.3s;
    transform-style: preserve-3d;
}

.coin:hover {
    transform: scale(1.02);
}

.coin-heads, .coin-tails {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

/* HEADS side - Gold theme */
.coin-heads {
    background: radial-gradient(circle at 30% 30%, #ffd700, #daa520);
    transform: rotateY(0deg);
    border: 3px solid #ffd700;
}

.coin-heads .coin-front {
    text-align: center;
    background: radial-gradient(circle at 40% 40%, rgba(255,215,0,0.3), transparent);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* TAILS side - Silver theme */
.coin-tails {
    background: radial-gradient(circle at 30% 30%, #e0e0e0, #a0a0a0);
    transform: rotateY(180deg);
    border: 3px solid #c0c0c0;
}

.coin-tails .coin-back {
    text-align: center;
    background: radial-gradient(circle at 40% 40%, rgba(192,192,192,0.3), transparent);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.coin-symbol {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.3rem;
}

.coin-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.coin-value {
    font-size: 1rem;
    margin-top: 0.3rem;
    opacity: 0.8;
}

.coin-heads .coin-text {
    color: #8B4513;
    text-shadow: 1px 1px 2px rgba(255,215,0,0.5);
}

.coin-tails .coin-text {
    color: #2c3e50;
    text-shadow: 1px 1px 2px rgba(192,192,192,0.5);
}

/* Flip Animation */
@keyframes flip-coin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(720deg); }
}

.coin.flipping {
    animation: flip-coin 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Action Buttons */
.coinflip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.7rem 1.3rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.primary-action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.primary-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124,58,237,0.3);
}

/* Result Section */
.coinflip-result {
    background: var(--bg);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

.result-header {
    margin-bottom: 0.5rem;
}

.result-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.coinflip-result-display {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    color: var(--text);
    padding: 1rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.result-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Recent Flips */
.recent-flips {
    background: var(--bg);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.recent-flips h3 {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: var(--text);
}

.recent-flips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 100px;
    overflow-y: auto;
}

.recent-flip-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.recent-flip-item.heads-flip {
    background: rgba(255, 215, 0, 0.2);
    color: #daa520;
    border: 1px solid #daa520;
}

.recent-flip-item.tails-flip {
    background: rgba(192, 192, 192, 0.2);
    color: #a0a0a0;
    border: 1px solid #a0a0a0;
}

.flip-time {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Options */
.coinflip-options {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.coinflip-options h3 {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.85rem;
}

/* Presets */
.preset-section {
    margin-bottom: 1.5rem;
}

.preset-section h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.preset-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.preset-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Share Modal */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.share-modal.active {
    display: flex;
}

.share-modal-content {
    background: var(--surface);
    border-radius: 24px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.share-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.share-btn {
    padding: 0.7rem 1.2rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.share-wa { background: #25D366; color: white; }
.share-twitter { background: #1DA1F2; color: white; }
.share-copy { background: var(--primary); color: white; }
.share-close { background: var(--border); color: var(--text); }

/* SEO */
.coinflip-seo {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.feature-list {
    padding-left: 1.2rem;
    margin: 0.8rem 0;
}

.feature-list li {
    margin-bottom: 0.4rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.related-article-cta {
    background: var(--bg);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    text-align: center;
    border-left: 4px solid var(--primary);
}

.imagesplit-related {
    max-width: 950px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.related-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1rem 0;
}

.related-category {
    flex: 1;
    min-width: 180px;
}

.related-category ul {
    list-style: none;
    padding-left: 0;
}

.related-category li {
    margin: 0.5rem 0;
}

.related-category a {
    color: var(--primary);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .coinflip-container {
        padding: 0 1rem;
    }
    
    .coinflip-title {
        font-size: 2rem;
    }
    
    .coinflip-card {
        padding: 1.2rem;
    }
    
    .coin {
        width: 160px;
        height: 160px;
    }
    
    .coin-symbol {
        font-size: 2.5rem;
    }
    
    .coin-text {
        font-size: 1.2rem;
    }
    
    .global-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .coinflip-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .coinflip-stat-card:nth-child(5) {
        grid-column: span 2;
    }
}