/**
 * ISKCON Posts Frontend Styles
 * File: assets/css/frontend.css
 * Inspired by calendar design but simplified for shortcode use
 */

/* Main Container */
.iskcon-wrapper { 
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 20px;
    font-family: "Poppins-Local", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Navigation Bar */
.iskcon-navigation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

/* Month Navigation */
.iskcon-month-nav {
    display: flex;
    align-items: center;
}

.iskcon-nav-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.iskcon-current-month {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1;
    min-width: 200px;
    text-align: center;
}

.iskcon-nav-btn {
    background: white;
    border: 1px solid #ddd;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.iskcon-nav-btn:hover {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,123,186,0.3);
}

.iskcon-nav-btn:active {
    transform: scale(0.95);
}

/* Download Section */
.iskcon-download-section {
    position: relative;
}

.iskcon-download-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(40,167,69,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.iskcon-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.3);
    background: linear-gradient(135deg, #20c997, #28a745);
}

/* Filter Styles */
.iskcon-filter { 
    margin: 20px 0; 
    padding: 20px; 
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px; 
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.iskcon-filter h4 { 
    margin: 0 0 15px 0; 
    color: #333; 
    font-size: 16px;
    font-weight: 600;
}

.iskcon-filter-options { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
    margin: 15px 0; 
}

.iskcon-filter-option { 
    padding: 8px 16px; 
    background: white; 
    border: 1px solid #ddd; 
    border-radius: 25px; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.iskcon-filter-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.iskcon-filter-option:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,186,0.2);
}

.iskcon-filter-option:hover::before {
    left: 100%;
}

.iskcon-filter-option input { 
    margin-right: 8px; 
}

.iskcon-filter-option.selected { 
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white; 
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,123,186,0.3);
}

.iskcon-filter-buttons { 
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.iskcon-btn { 
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white; 
    border: none; 
    padding: 12px 24px; 
    border-radius: 25px; 
    cursor: pointer; 
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,123,186,0.2);
    position: relative;
    overflow: hidden;
}

.iskcon-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.iskcon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,186,0.3);
}

.iskcon-btn:hover::before {
    width: 300px;
    height: 300px;
}

.iskcon-btn.clear { 
    background: linear-gradient(135deg, #6c757d, #545b62);
    box-shadow: 0 4px 12px rgba(108,117,125,0.2);
}

.iskcon-btn.clear:hover { 
    box-shadow: 0 6px 20px rgba(108,117,125,0.3);
}

/* Posts Container */
.iskcon-posts { 
    margin: 30px 0; 
}

.iskcon-posts.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.iskcon-posts.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Event Card Styles - Inspired by calendar cards */
.iskcon-post { 
    position: relative;
    border: none;
    padding: 0; 
    margin: 0; 
    border-radius: 15px; 
    overflow: hidden;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.iskcon-post:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    z-index: 10;
}

/* Event Card Header - Beautiful gradients like calendar */
.iskcon-post-header {
    position: relative;
    padding: 25px;
    color: white;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Event Type Specific Headers - From calendar design */
.iskcon-post-header.ekadasi { 
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); 
}

.iskcon-post-header.festival { 
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); 
}

.iskcon-post-header.courses { 
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); 
}

.iskcon-post-header.guest_speaker { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
}

.iskcon-post-header.news { 
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%); 
}

.iskcon-post-header.lcvs_speaker { 
    background: linear-gradient(135deg, #fdbb2d 0%, #22c1c3 100%); 
}

.iskcon-post-header.recent_vip { 
    background: linear-gradient(135deg, #ff9a56 0%, #ffad56 100%); 
}

.iskcon-post-header.team_member { 
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); 
}

.iskcon-post-header.daily_darshan { 
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%); 
}

.iskcon-event-badge { 
    background: rgba(255,255,255,0.25); 
    color: white; 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 600;
    margin-bottom: 15px; 
    display: inline-block; 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.iskcon-post-title { 
    margin: 0 0 15px 0; 
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.iskcon-post-title a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.iskcon-post-title a:hover {
    opacity: 0.9;
}

/* Date Badge - From calendar design */
.iskcon-date-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.4);
    color: white;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    min-width: 70px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.iskcon-date-badge .day {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    line-height: 1;
    opacity: 0.8;
}

.iskcon-date-badge .date {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    margin: 4px 0;
}

.iskcon-date-badge .month {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    line-height: 1;
    opacity: 0.8;
}

/* Event Card Body */
.iskcon-post-body {
    padding: 25px 25px 80px 25px; /* Extra bottom padding for countdown */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Position countdown at the bottom of the card */
.iskcon-post-body .iskcon-countdown {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    margin: 0;
}

/* Override countdown styling for card context */
.iskcon-post-body .iskcon-countdown {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    border-radius: 15px;
    padding: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.iskcon-post-body .iskcon-countdown .countdown-label {
    color: white;
}

.iskcon-post-body .iskcon-countdown .countdown-number {
    color: white;
}

.iskcon-post-body .iskcon-countdown .countdown-unit {
    color: white;
}

.iskcon-post-meta { 
    color: #666; 
    font-size: 14px; 
    margin-bottom: 20px; 
    line-height: 1.6;
}

.iskcon-post-meta > div {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.iskcon-post-meta > div:last-child {
    border-bottom: none;
}

.iskcon-post-meta .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: #0073aa;
    margin-top: 1px;
    flex-shrink: 0;
}

.iskcon-content {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.7;
    flex-grow: 1;
}

.iskcon-read-more {
    display: inline-flex;
    align-items: center;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 10px 0;
    margin-top: auto;
}

.iskcon-read-more:hover {
    color: #005a87;
    transform: translateX(5px);
}

.iskcon-read-more .dashicons {
    transition: transform 0.3s ease;
}

.iskcon-read-more:hover .dashicons {
    transform: translateX(3px);
}

/* Countdown Timer - From original calendar design */
.iskcon-countdown {
    margin: 20px 0 15px 0;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
}

.iskcon-countdown.countdown-initialized {
    opacity: 1;
}

.countdown-timer {
    text-align: center;
}

.countdown-digits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.countdown-label-item {
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    min-width: auto !important;
}

.countdown-label-item .countdown-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin: auto 10px;
    color: white;
    text-align: center;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    line-height: 1.2;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 12px 10px;
    border-radius: 12px;
    min-width: 60px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.38);
    transition: all 0.3s ease;
}

.countdown-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.4);
}

.countdown-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: white;
}

.countdown-unit {
    display: block;
    font-size: 10px;
    opacity: 0.8;
    margin-top: 4px;
    font-weight: 500;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-expired {
    color: #fb176c;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    padding: 15px;
    background: rgba(1, 1, 1, 0.5);
    border-radius: 10px;
    width: 100%;
    backdrop-filter: blur(10px);
}

/* Loading state for countdown */
.iskcon-countdown:not(.countdown-initialized)::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* No Results */
.iskcon-no-results { 
    text-align: center; 
    padding: 60px 40px; 
    color: #666; 
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    font-style: italic;
    font-size: 16px;
    grid-column: 1 / -1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* List View Specific */
.list-view .iskcon-post {
    display: flex;
    align-items: stretch;
    min-height: 200px;
}

.list-view .iskcon-post-header {
    flex: 0 0 250px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.list-view .iskcon-post-body {
    flex: 1;
}

.list-view .iskcon-date-badge {
    position: static;
    margin-bottom: 15px;
    align-self: flex-start;
}

.list-view .iskcon-post-title {
    font-size: 18px;
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.iskcon-posts.loading {
    opacity: 0.7;
    pointer-events: none;
}

.iskcon-posts.loading .iskcon-post {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .iskcon-wrapper {
        padding: 0 15px;
    }
    
    .iskcon-posts.grid-view {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (max-width: 968px) {
    .iskcon-navigation-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .iskcon-month-nav {
        justify-content: center;
    }
    
    .iskcon-current-month {
        font-size: 1.4rem;
        min-width: auto;
    }
    
    .iskcon-download-section {
        display: flex;
        justify-content: center;
    }
    
    .iskcon-download-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .iskcon-wrapper {
        padding: 0 10px;
    }
    
    .iskcon-navigation-bar {
        padding: 10px 0;
    }
    
    .iskcon-nav-group {
        gap: 10px;
    }
    
    .iskcon-current-month {
        font-size: 1.2rem;
    }
    
    .iskcon-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .iskcon-filter {
        padding: 15px;
    }
    
    .iskcon-filter-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .iskcon-filter-option {
        text-align: center;
        padding: 10px 16px;
    }
    
    .iskcon-filter-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .iskcon-btn {
        text-align: center;
    }
    
    .iskcon-posts.grid-view {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .list-view .iskcon-post {
        flex-direction: column;
    }
    
    .list-view .iskcon-post-header {
        flex: none;
    }
    
    .iskcon-post-header {
        padding: 20px;
        min-height: 160px;
    }
    
    .iskcon-date-badge {
        position: static !important;
        margin-bottom: 15px;
        align-self: flex-start;
    }
    
    .iskcon-post-body {
        padding: 20px;
    }
    
    .iskcon-post-title {
        font-size: 18px;
    }
    
    .countdown-digits {
        gap: 8px;
    }
    
    .countdown-item {
        min-width: 50px;
        padding: 10px 8px;
    }
    
    .countdown-number {
        font-size: 16px;
    }
    
    .countdown-label-item .countdown-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .iskcon-nav-group {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .iskcon-current-month {
        font-size: 1.1rem;
        order: -1;
    }
    
    .iskcon-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .iskcon-download-btn {
        font-size: 12px;
        padding: 10px 16px;
    }
    
    .iskcon-post {
        min-height: 350px;
    }
    
    .iskcon-post-header {
        padding: 15px;
        min-height: 140px;
    }
    
    .iskcon-post-body {
        padding: 15px;
    }
    
    .iskcon-post-title {
        font-size: 16px;
    }
    
    .iskcon-date-badge {
        min-width: 60px;
        padding: 10px;
    }
    
    .iskcon-date-badge .date {
        font-size: 20px;
    }
    
    .iskcon-post-meta > div {
        margin-bottom: 8px;
        padding: 6px 0;
    }
    
    .iskcon-no-results {
        padding: 40px 20px;
        font-size: 14px;
    }
    
    .countdown-digits {
        gap: 6px;
    }
    
    .countdown-item {
        min-width: 45px;
        padding: 8px 6px;
    }
    
    .countdown-number {
        font-size: 14px;
    }
    
    .countdown-unit {
        font-size: 9px;
    }
    
    .countdown-label-item .countdown-label {
        font-size: 10px;
    }
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth entrance animations */
.iskcon-post {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Stagger animation for multiple cards */
.iskcon-post:nth-child(1) { animation-delay: 0.1s; }
.iskcon-post:nth-child(2) { animation-delay: 0.2s; }
.iskcon-post:nth-child(3) { animation-delay: 0.3s; }
.iskcon-post:nth-child(4) { animation-delay: 0.4s; }
.iskcon-post:nth-child(5) { animation-delay: 0.5s; }
.iskcon-post:nth-child(6) { animation-delay: 0.6s; }