/* Frontend Styles */
.cg-giveaways-container {
    margin: 40px 0;
}

.cg-no-giveaways {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.cg-giveaways-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

/* Giveaway Card */
.cg-giveaway-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, opacity 0.2s;
    opacity: 1;
}

.cg-giveaway-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.cg-giveaway-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.cg-giveaway-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #1a1a1a;
    font-weight: 700;
}

.cg-giveaway-description {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Prizes Section */
.cg-giveaway-prizes {
    margin-bottom: 20px;
}

.cg-prizes-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.cg-prizes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cg-prize-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.cg-prize-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dee2e6;
}

.cg-prize-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cg-prize-details {
    flex-grow: 1;
}

.cg-prize-position {
    display: inline-block;
    background: #c32424;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
}

.cg-prize-title {
    margin: 5px 0 0 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Meta Information */
.cg-giveaway-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cg-meta-item {
    display: flex;
    flex-direction: column;
}

.cg-meta-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.cg-meta-value {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 700;
}

.cg-countdown {
    color: #c32424;
}

.cg-countdown.cg-ended {
    color: #999;
    font-weight: 500;
}

/* Condition */
.cg-giveaway-condition {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #1e40af;
    border-left: 4px solid #1e3a8a;
    border-radius: 4px;
    margin-bottom: 20px;
}

.cg-condition-icon {
    font-size: 20px;
}

.cg-condition-text {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

/* Actions */
.cg-giveaway-actions {
    margin-top: 20px;
}

.cg-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: normal !important;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    max-width: 100%;
    box-sizing: border-box;
}

.cg-button-primary {
    background: #c32424;
    color: #fff;
}

.cg-button-primary:hover {
    background: #a01d1d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(195, 36, 36, 0.4);
}

.cg-button-success {
    background: #1a1a1a;
    color: #fff;
    cursor: default;
}

.cg-button-disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.cg-checkmark {
    font-size: 18px;
    margin-right: 5px;
}

/* Messages */
.cg-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    max-width: 350px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cg-message.success {
    background: #1a1a1a;
    color: #fff;
}

.cg-message.error {
    background: #c32424;
    color: #fff;
}

.cg-message.info {
    background: #1a1a1a;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .cg-giveaways-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cg-giveaway-card {
        padding: 20px;
    }
    
    .cg-giveaway-title {
        font-size: 20px;
    }
    
    .cg-giveaway-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cg-prize-image {
        width: 60px;
        height: 60px;
    }
    
    .cg-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cg-giveaway-card {
        padding: 15px;
    }
    
    .cg-button {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Loading State */
.cg-button.loading {
    position: relative;
    pointer-events: none;
}

.cg-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Floating Button */
.cg-floating-button {
    position: fixed !important;
    z-index: 1200 !important;
    padding: 16px 24px;
    background: #c32424;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(195, 36, 36, 0.4);
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    animation: floatingPulse 2s ease-in-out infinite;
    display: flex !important;
    align-items: center;
    gap: 8px;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.cg-floating-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 30px rgba(195, 36, 36, 0.6);
    background: #a01d1d;
    color: #fff;
    text-decoration: none;
}

.cg-floating-button:active {
    transform: translateY(-1px) scale(1.02);
}

/* Position variants */
.cg-floating-bottom-right {
    bottom: 30px !important;
    right: 30px !important;
}

.cg-floating-bottom-left {
    bottom: 30px !important;
    left: 30px !important;
}

.cg-floating-top-right {
    top: 30px !important;
    right: 30px !important;
}

.cg-floating-top-left {
    top: 30px !important;
    left: 30px !important;
}

/* Admin bar adjustment */
.admin-bar .cg-floating-top-right,
.admin-bar .cg-floating-top-left {
    top: 62px !important;
}

@media screen and (max-width: 782px) {
    .admin-bar .cg-floating-top-right,
    .admin-bar .cg-floating-top-left {
        top: 76px !important;
    }
}

.cg-floating-text {
    white-space: nowrap;
}

@keyframes floatingPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(195, 36, 36, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(195, 36, 36, 0.7);
    }
}

/* Mobile adjustments for floating button */
@media (max-width: 768px) {
    .cg-floating-button {
        padding: 14px 20px;
        font-size: 14px;
        border-radius: 40px;
    }
    
    .cg-floating-bottom-right,
    .cg-floating-top-right {
        right: 15px;
    }
    
    .cg-floating-bottom-left,
    .cg-floating-top-left {
        left: 15px;
    }
    
    .cg-floating-bottom-right,
    .cg-floating-bottom-left {
        bottom: 15px;
    }
    
    .cg-floating-top-right,
    .cg-floating-top-left {
        top: 15px;
    }
}

@media (max-width: 480px) {
    .cg-floating-button {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Page wrapper styling */
.page .cg-giveaways-container,
.single .cg-giveaways-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Upcoming giveaway state */
.cg-card-upcoming {
    opacity: 0.8;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
}

.cg-card-upcoming:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.2);
}

/* Requirements not met state */
.cg-card-requirements-not-met {
    opacity: 0.65;
    background: #f9f9f9;
    border: 2px solid #ddd;
}

.cg-card-requirements-not-met:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Processing giveaway state */
.cg-card-processing {
    opacity: 0.7;
    background: #fff9e6;
    border: 2px solid #ffc107;
}

.cg-card-processing:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
}

/* Winner giveaway state */
.cg-card-winner {
    border: 3px solid #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.cg-card-winner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 24px rgba(34, 197, 94, 0.4);
}

/* Lost giveaway state */
.cg-card-lost {
    opacity: 0.6;
    background: #f5f5f5;
    border: 3px solid #ef4444;
}

.cg-card-lost:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Processing banner */
.cg-processing-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: -25px -25px 20px -25px;
    border-radius: 12px 12px 0 0;
}

.cg-processing-banner .cg-spinner {
    font-size: 20px;
}

/* Status messages */
.cg-status-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.cg-status-upcoming {
    background: #e0f2fe;
    color: #0369a1;
    border: 2px solid #0ea5e9;
}

.cg-status-requirements-not-met {
    background: #f8f8f8;
    color: #666;
    border: 2px solid #ddd;
}

.cg-giveaway-card .cg-status-message.cg-status-processing {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 2px solid #ffc107 !important;
}

.cg-giveaway-card .cg-status-message.cg-status-winner {
    background: #15803d !important;
    color: #fff !important;
    border: 3px solid #15803d !important;
    animation: winnerPulse 1.5s ease-in-out infinite !important;
}

.cg-giveaway-card .cg-status-message.cg-status-lost {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 3px solid #ef4444 !important;
}

.cg-spinner {
    font-size: 24px;
    animation: spin 2s linear infinite;
}

.cg-trophy {
    font-size: 28px;
    animation: bounce 1s ease-in-out infinite;
}

.cg-sad {
    font-size: 24px;
}

.cg-lock {
    font-size: 24px;
}

.cg-clock {
    font-size: 24px;
}

@keyframes winnerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px 5px rgba(21, 128, 61, 0.6);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Hero section for giveaway page */
.cg-page-hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: linear-gradient(135deg, #c32424 0%, #1a1a1a 100%);
    color: #fff;
    margin: -20px -20px 40px -20px;
    border-radius: 0 0 20px 20px;
}

.cg-page-hero h1 {
    margin: 0 0 15px 0;
    font-size: 48px;
    font-weight: 800;
    color: #fff;
}

.cg-page-hero p {
    margin: 0;
    font-size: 20px;
    opacity: 0.95;
}

@media (max-width: 768px) {
    .cg-page-hero {
        padding: 40px 20px 30px;
    }
    
    .cg-page-hero h1 {
        font-size: 32px;
    }
    
    .cg-page-hero p {
        font-size: 16px;
    }
}

/* Share Button */
.cg-button-share {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cg-button-share:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cg-share-icon {
    font-size: 20px;
}

/* Share Modal */
.cg-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.cg-share-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cg-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s;
}

.cg-modal-close:hover {
    color: #333;
}

.cg-share-modal-title {
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
}

.cg-share-modal-description {
    margin: 0 0 24px 0;
    color: #666;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
}

.cg-share-buttons {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.cg-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.cg-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cg-share-btn svg {
    width: 24px;
    height: 24px;
}

.cg-share-facebook {
    background: #1877f2;
}

.cg-share-facebook:hover {
    background: #0d66d5;
}

.cg-share-twitter {
    background: #1da1f2;
}

.cg-share-twitter:hover {
    background: #0c90e0;
}

.cg-share-linkedin {
    background: #0077b5;
}

.cg-share-linkedin:hover {
    background: #006399;
}

.cg-share-whatsapp {
    background: #25d366;
}

.cg-share-whatsapp:hover {
    background: #1fbd57;
}

.cg-share-copy {
    background: #6b7280;
}

.cg-share-copy:hover {
    background: #4b5563;
}

.cg-share-note {
    margin: 0;
    color: #999;
    font-size: 13px;
    text-align: center;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .cg-share-modal-content {
        padding: 24px;
        margin: 20px;
    }
    
    .cg-share-modal-title {
        font-size: 24px;
    }
    
    .cg-share-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}
