/**
 * COMM-IT News & Announcements
 * @author Tahir - comm-it.in
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

.cna-wrapper {
    --cna-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    padding: 20px 15px;
    font-family: var(--cna-font);
}

.cna-wrapper *, .cna-wrapper *::before, .cna-wrapper *::after {
    box-sizing: border-box;
}

/* Navigation */
.cna-nav {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 25px;
    padding-right: 10px;
}

.cna-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.cna-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.cna-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Container */
.cna-container {
    overflow: hidden;
    margin: 0 -15px;
    padding: 15px;
}

.cna-track {
    display: flex;
    gap: 25px;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Card */
.cna-card {
    flex: 0 0 calc(33.333% - 17px);
    min-width: calc(33.333% - 17px);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.cna-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

/* Upcoming Badge */
.cna-upcoming-badge {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 10 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #fff !important;
    padding: 8px 14px !important;
    border-radius: 25px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
    animation: cna-pulse 2s infinite !important;
}

.cna-upcoming-badge svg {
    width: 14px !important;
    height: 14px !important;
    fill: #fff !important;
    stroke: #fff !important;
}

/* Pulse animation for upcoming badge */
@keyframes cna-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(245, 158, 11, 0.7);
    }
}

/* Card with upcoming badge - adjust icon position */
.cna-upcoming .cna-icon {
    opacity: 0.3 !important;
}

.cna-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.cna-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Card Header */
.cna-card-header {
    padding: 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 130px;
}

.cna-date { color: #fff; }

.cna-day {
    display: block;
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cna-month {
    display: block;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

.cna-year {
    display: block;
    font-size: 15px;
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.85;
}

.cna-icon {
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Card Body - Fixed height for alignment */
.cna-card-body {
    padding: 22px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 160px !important;
}

.cna-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

/* Attachments */
.cna-attachments {
    display: flex !important;
    gap: 8px !important;
    margin-top: 12px !important;
    margin-bottom: 15px !important;
    flex-wrap: wrap !important;
    flex-shrink: 0 !important;
}

.cna-att-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 5px 12px !important;
    background: #f0f4f8 !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #555 !important;
}

/* Read More - Pushed to bottom */
.cna-read-more {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 24px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border-radius: 30px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    margin-top: auto !important;
    align-self: flex-start !important;
}

.cna-card:hover .cna-read-more {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Empty */
.cna-empty {
    text-align: center;
    padding: 60px 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    color: #666;
    font-size: 18px;
}

/* ========== RESPONSIVE - TABLET ========== */
@media (max-width: 1100px) {
    .cna-card {
        flex: 0 0 calc(50% - 13px);
        min-width: calc(50% - 13px);
    }
    
    .cna-card-header { min-height: 120px; padding: 22px 18px; }
    .cna-day { font-size: 42px; }
}

/* ========== RESPONSIVE - MOBILE ========== */
@media (max-width: 700px) {
    .cna-wrapper { 
        padding: 15px 12px !important; 
    }
    .cna-nav { 
        margin-bottom: 18px !important; 
        gap: 10px !important;
        padding-right: 5px !important;
    }
    .cna-btn { width: 40px !important; height: 40px !important; }
    
    .cna-container {
        margin: 0 -8px !important;
        padding: 8px !important;
    }
    
    .cna-track { 
        gap: 12px !important; 
    }
    
    /* 2 cards on mobile */
    .cna-card {
        flex: 0 0 calc(50% - 6px) !important;
        min-width: calc(50% - 6px) !important;
        border-radius: 14px !important;
    }
    
    .cna-card-header { 
        padding: 14px 12px !important; 
        min-height: 90px !important; 
    }
    .cna-day { font-size: 28px !important; }
    .cna-month { font-size: 11px !important; letter-spacing: 1px !important; }
    .cna-year { font-size: 11px !important; }
    .cna-icon { 
        width: 36px !important; 
        height: 36px !important; 
        border-radius: 8px !important; 
    }
    .cna-icon svg {
        width: 20px !important;
        height: 20px !important;
    }
    .cna-card-body { 
        padding: 12px !important; 
        min-height: 120px !important; 
    }
    .cna-title { 
        font-size: 13px !important; 
        -webkit-line-clamp: 2 !important;
        margin-bottom: 8px !important;
    }
    .cna-attachments {
        margin-top: 8px !important;
        margin-bottom: 10px !important;
    }
    .cna-att-badge {
        padding: 3px 8px !important;
        font-size: 10px !important;
    }
    .cna-read-more { 
        padding: 8px 14px !important; 
        font-size: 11px !important; 
        border-radius: 20px !important;
    }
    .cna-read-more svg {
        width: 12px !important;
        height: 12px !important;
    }
    
    /* Upcoming badge on mobile */
    .cna-upcoming-badge {
        top: 8px !important;
        right: 8px !important;
        padding: 5px 10px !important;
        font-size: 9px !important;
    }
    .cna-upcoming-badge svg {
        width: 10px !important;
        height: 10px !important;
    }
}

/* ========== SMALL MOBILE (under 400px) ========== */
@media (max-width: 400px) {
    .cna-wrapper { 
        padding: 12px 10px !important; 
    }
    
    .cna-track { 
        gap: 10px !important; 
    }
    
    .cna-card {
        flex: 0 0 calc(50% - 5px) !important;
        min-width: calc(50% - 5px) !important;
        border-radius: 12px !important;
    }
    
    .cna-card-header { 
        padding: 12px 10px !important; 
        min-height: 80px !important; 
    }
    .cna-day { font-size: 24px !important; }
    .cna-month { font-size: 10px !important; }
    .cna-year { font-size: 10px !important; }
    .cna-icon { 
        width: 32px !important; 
        height: 32px !important; 
    }
    .cna-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
    .cna-card-body { 
        padding: 10px !important; 
        min-height: 110px !important; 
    }
    .cna-title { 
        font-size: 12px !important; 
    }
    .cna-read-more { 
        padding: 6px 12px !important; 
        font-size: 10px !important; 
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cna-track, .cna-card, .cna-btn, .cna-read-more { transition: none; }
}

/* Print */
@media print {
    .cna-nav { display: none; }
    .cna-track { flex-wrap: wrap; transform: none !important; }
    .cna-card { flex: 0 0 100%; margin-bottom: 20px; box-shadow: none; border: 1px solid #ddd; }
}
