/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* APB Frontend Styles - Clean Modern Design */

:root {
    /* Modern Clean Color Palette */
    --apb-primary: #2563eb;      /* Blue - Professional & Trustworthy */
    --apb-secondary: #059669;    /* Emerald - Success & Growth */
    --apb-accent: #dc2626;       /* Red - Attention & Urgency */
    --apb-accent-alt: #7c3aed;   /* Purple - Premium & Elegant */
    --apb-success: #059669;      /* Emerald Green */
    --apb-warning: #d97706;      /* Orange */
    --apb-danger: #dc2626;       /* Red */
    --apb-info: #2563eb;         /* Blue */
    --apb-gray: #6b7280;         /* Neutral Gray */
    --apb-light-gray: #f9fafb;   /* Light Background */
    --apb-dark: #111827;         /* Dark Text */
    
    /* Shadows */
    --apb-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --apb-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --apb-shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --apb-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    
    /* Border Radius */
    --apb-radius-sm: 6px;
    --apb-radius: 12px;
    --apb-radius-lg: 16px;
    --apb-radius-xl: 24px;
    
    /* Typography */
    --apb-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --apb-font-secondary: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Base */
* {
    box-sizing: border-box;
}

/* Container */
.apb-campaigns-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--apb-light-gray);
    min-height: 100vh;
}

/* Campaign Card */
.apb-campaign-card {
    background: white;
    border-radius: var(--apb-radius-lg);
    box-shadow: var(--apb-shadow);
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.apb-campaign-card:hover {
    box-shadow: var(--apb-shadow-lg);
    transform: translateY(-2px);
}

/* Card Header */
.apb-card-header {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.apb-card-banner {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--apb-primary), var(--apb-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.apb-default-banner::before {
    content: '🎯';
    font-size: 32px;
}

/* Card Badges */
.apb-card-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.apb-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--apb-radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
    color: white;
}

.apb-badge-success { background: var(--apb-success); }
.apb-badge-info { background: var(--apb-info); }
.apb-badge-danger { background: var(--apb-danger); }

/* Card Content */
.apb-card-content {
    padding: 20px;
}

.apb-card-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.apb-card-title {
    font-family: var(--apb-font-secondary);
    font-size: 18px;
    font-weight: 700;
    color: var(--apb-dark);
    margin: 0;
    line-height: 1.3;
}

.apb-view-details-btn {
    background: white;
    border: 1px solid var(--apb-primary);
    color: var(--apb-primary);
    padding: 6px 12px;
    border-radius: var(--apb-radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.apb-view-details-btn:hover {
    background: var(--apb-primary);
    color: white;
}

.apb-card-description {
    font-size: 14px;
    color: var(--apb-gray);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Progress Section */
.apb-campaign-target {
    background: #f3f4f6;
    border-radius: var(--apb-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.apb-target-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.apb-target-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--apb-gray);
    text-transform: uppercase;
}

.apb-target-value {
    font-weight: 700;
    color: var(--apb-dark);
}

/* Progress Bar */
.apb-progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.apb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--apb-primary), var(--apb-secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.apb-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--apb-gray);
}

/* Reward Section */
.apb-campaign-reward {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--apb-radius);
    padding: 12px;
    margin-bottom: 16px;
}

.apb-reward-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apb-reward-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--apb-success);
    text-transform: uppercase;
}

.apb-reward-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--apb-success);
}

/* Buttons */
.apb-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--apb-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--apb-font-primary);
}

.apb-btn-primary {
    background: var(--apb-primary);
    color: white;
}

.apb-btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--apb-shadow);
}

.apb-btn-success {
    background: var(--apb-success);
    color: white;
}

.apb-btn-success:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: var(--apb-shadow);
}

.apb-btn-disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Card States */
.apb-campaign-card.apb-expired {
    opacity: 0.7;
    filter: grayscale(0.3);
}

.apb-campaign-card.apb-completed {
    border-left: 4px solid var(--apb-success);
}

.apb-campaign-card.apb-claimed {
    border-left: 4px solid var(--apb-accent-alt);
}

/* Modal */
.apb-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.apb-modal.show {
    display: flex;
}

.apb-modal-content {
    background: white;
    border-radius: var(--apb-radius-lg);
    box-shadow: var(--apb-shadow-lg);
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    width: 100%;
}

.apb-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apb-modal-title {
    font-family: var(--apb-font-secondary);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--apb-dark);
}

.apb-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--apb-gray);
    padding: 4px;
}

.apb-modal-close:hover {
    color: var(--apb-dark);
}

.apb-modal-body {
    padding: 20px;
}

.apb-modal-description {
    color: var(--apb-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.apb-modal-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.apb-modal-meta-item {
    background: #f9fafb;
    border-radius: var(--apb-radius);
    padding: 12px;
}

.apb-modal-meta-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--apb-gray);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.apb-modal-meta-value {
    font-weight: 600;
    color: var(--apb-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .apb-campaigns-container {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .apb-modal-meta {
        grid-template-columns: 1fr;
    }
}

/* Error/Empty States */
.apb-error,
.apb-no-campaigns,
.apb-login-required {
    background: white;
    border-radius: var(--apb-radius-lg);
    box-shadow: var(--apb-shadow);
    padding: 40px;
    text-align: center;
    color: var(--apb-gray);
    border: 1px solid #e5e7eb;
}

.apb-error {
    border-left: 4px solid var(--apb-danger);
    color: var(--apb-danger);
}

/* Notifications */
.apb-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: var(--apb-radius);
    color: white;
    font-weight: 600;
    z-index: 10001;
    min-width: 250px;
    box-shadow: var(--apb-shadow-lg);
}

.apb-notification.apb-success { background: var(--apb-success); }
.apb-notification.apb-error { background: var(--apb-danger); }
.apb-notification.apb-info { background: var(--apb-info); }

/* Loading Animation */
.apb-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: var(--apb-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}