/**
 * C27 Master Campaigns - Main Stylesheet
 * 
 * Shared styles for master campaign displays and components.
 */

/* ==================== SHARED STYLES ==================== */

.c27-master-leaderboard {
    line-height: 1.6;
    color: #333;
}

/* Error and empty states */
.c27-error,
.c27-no-campaigns {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin: 1rem 0;
}

.c27-leaderboard-empty {
    background: #f8f9fa;
    color: #6c757d;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    margin: 1rem 0;
}

/* ==================== PROGRESS COMPONENTS ==================== */

/* Progress Bar */
.c27-progress-bar-bg {
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.c27-progress-bar-fill {
    height: 100%;
    transition: width 0.3s ease, transform 0.2s ease;
    border-radius: inherit;
}

/* Progress Circle */
.c27-progress-circle {
    position: relative;
    display: inline-block;
}

.c27-progress-circle svg {
    transform: rotate(-90deg);
}

.c27-progress-circle-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 8;
}

.c27-progress-circle-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.c27-progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-weight: 700;
}

/* ==================== METRICS ==================== */

.c27-metric {
    text-align: center;
    padding: 1rem;
    background: #F8F9FA;
    border-radius: 12px;
}

.c27-metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.c27-metric-label {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    line-height: 1.2;
}

/* ==================== BUTTONS ==================== */

.c27-master-campaign-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.c27-master-campaign-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.c27-master-campaign-btn:active {
    transform: translateY(0);
}

.c27-master-campaign-btn-secondary {
    background: #6c757d;
}

.c27-master-campaign-btn-secondary:hover {
    background: #545b62;
}

/* ==================== CARDS ==================== */

.c27-master-campaign-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.c27-master-campaign-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.c27-master-campaign-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.c27-master-campaign-card-content {
    padding: 1.5rem;
}

.c27-master-campaign-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #333;
}

.c27-master-campaign-card-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* ==================== GRIDS ==================== */

.c27-master-campaign-grid {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.c27-master-campaign-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.c27-master-campaign-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.c27-master-campaign-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.c27-animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.c27-animate-slide-in {
    animation: slideInLeft 0.6s ease forwards;
}

.c27-animate-pulse {
    animation: pulse 2s infinite;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 1200px) {
    .c27-master-campaign-grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .c27-master-campaign,
    .c27-master-leaderboard {
        margin: 0rem;
        padding: 0rem;
    }
    
    .c27-master-campaign-grid {
        gap: 1rem;
    }
    
    .c27-master-campaign-grid-2,
    .c27-master-campaign-grid-3,
    .c27-master-campaign-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .c27-metric {
        padding: 1rem;
    }
    
    .c27-metric-value {
        font-size: 1.5rem;
    }
    
    .c27-master-campaign-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .c27-master-campaign,
    .c27-master-leaderboard {
        margin: 0rem;
        padding: 0rem;
    }
    
    .c27-metric-value {
        font-size: 1.3rem;
    }
    
    .c27-metric-label {
        font-size: 0.8rem;
    }
}

/* ==================== ACCESSIBILITY ==================== */

/* Focus states */
.c27-master-campaign-btn:focus,
.c27-master-campaign-card:focus-within {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .c27-master-campaign,
    .c27-master-leaderboard {
        border: 2px solid #000;
    }
    
    .c27-progress-bar-bg {
        border: 1px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .c27-progress-bar-fill,
    .c27-progress-circle-fill,
    .c27-metric,
    .c27-master-campaign-card,
    .c27-master-campaign-btn {
        transition: none;
    }
    
    .c27-animate-fade-in,
    .c27-animate-slide-in,
    .c27-animate-pulse {
        animation: none;
    }
}

/* ==================== PRINT STYLES ==================== */

@media print {
    .c27-master-campaign,
    .c27-master-leaderboard {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .c27-master-campaign-btn {
        display: none;
    }
    
    .c27-progress-circle {
        page-break-inside: avoid;
    }
}

/* ==================== UTILITY CLASSES ==================== */

.c27-text-center { text-align: center; }
.c27-text-left { text-align: left; }
.c27-text-right { text-align: right; }

.c27-mb-1 { margin-bottom: 0.5rem; }
.c27-mb-2 { margin-bottom: 1rem; }
.c27-mb-3 { margin-bottom: 1.5rem; }
.c27-mb-4 { margin-bottom: 2rem; }

.c27-mt-1 { margin-top: 0.5rem; }
.c27-mt-2 { margin-top: 1rem; }
.c27-mt-3 { margin-top: 1.5rem; }
.c27-mt-4 { margin-top: 2rem; }

.c27-p-1 { padding: 0.5rem; }
.c27-p-2 { padding: 1rem; }
.c27-p-3 { padding: 1.5rem; }
.c27-p-4 { padding: 2rem; }

.c27-hidden { display: none; }
.c27-visible { display: block; }

.c27-rounded { border-radius: 8px; }
.c27-rounded-lg { border-radius: 12px; }
.c27-rounded-full { border-radius: 50%; }

.c27-shadow { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.c27-shadow-lg { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); }
