/**
 * Kiwanis Thank You Notes - Frontend Styles
 * Skeuomorphic paper note card design
 */

/* Main Grid Container */
.kiwanisty-grid {
    display: grid;
    gap: 3rem;
    margin: 3rem 0;
    padding: 1rem;
    list-style: none;
}

/* Column Configurations */
.kiwanisty-columns-1 {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 3rem auto;
}

.kiwanisty-columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.kiwanisty-columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.kiwanisty-columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Individual Thank You Note Card - Paper-like design */
.kiwanisty-note {
    background: linear-gradient(to bottom, #fffef9 0%, #fffcf5 100%);
    border: 1px solid #e8dcc8;
    border-radius: 3px;
    padding: 2.5rem 2rem;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Subtle paper texture */
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.01) 2px, rgba(0,0,0,0.01) 3px);
}

/* Decorative top border - like a ribbon on a card */
.kiwanisty-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #c8ad7f 0%, #d4bc8e 50%, #c8ad7f 100%);
    border-radius: 3px 3px 0 0;
}

/* Subtle corner fold effect */
.kiwanisty-note::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 20px 20px 0;
    border-color: transparent #f5ede0 transparent transparent;
    border-radius: 0 3px 0 0;
}

.kiwanisty-note:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.1),
        0 8px 20px rgba(0, 0, 0, 0.08),
        0 16px 36px rgba(0, 0, 0, 0.06);
}

/* Content Area */
.kiwanisty-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 0.5rem;
}

/* Title (Recipient Name/Organization) */
.kiwanisty-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c2416;
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
    font-family: Georgia, 'Times New Roman', serif;
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e8dcc8;
}

/* Memo Field - Handwritten note style */
.kiwanisty-memo {
    color: #3a3a3a;
    font-size: 1.6rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    padding: 1.25rem 0.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-style: italic;
    text-align: left;
}

/* PDF Preview Container */
.kiwanisty-pdf-preview {
    margin-top: auto;
}

.kiwanisty-pdf-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.kiwanisty-pdf-link:hover {
    opacity: 0.95;
}

/* PDF Thumbnail */
.kiwanisty-pdf-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* PDF Overlay (appears on hover) */
.kiwanisty-pdf-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4));
    color: #fff;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kiwanisty-pdf-link:hover .kiwanisty-pdf-overlay {
    opacity: 1;
}

.kiwanisty-pdf-overlay .dashicons {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
}

/* PDF Fallback (when thumbnail generation fails) */
.kiwanisty-pdf-fallback {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(231, 76, 60, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #c0392b;
}

.kiwanisty-pdf-link:hover .kiwanisty-pdf-fallback {
    background: linear-gradient(135deg, #ec7063 0%, #e74c3c 100%);
    transform: translateY(-2px);
    box-shadow:
        0 4px 8px rgba(231, 76, 60, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.2);
}

.kiwanisty-pdf-link:active .kiwanisty-pdf-fallback {
    transform: translateY(0);
    box-shadow:
        0 1px 2px rgba(231, 76, 60, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.15);
}

.kiwanisty-pdf-fallback .dashicons {
    font-size: 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.1);
    }
    20% {
        transform: scale(1);
    }
}

.kiwanisty-pdf-fallback span:last-child {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* No Notes Message */
.kiwanisty-no-notes {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* Tablet Responsive */
@media screen and (max-width: 768px) {
    .kiwanisty-grid {
        gap: 1.5rem;
        margin: 1.5rem 0;
    }

    .kiwanisty-columns-3,
    .kiwanisty-columns-4 {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .kiwanisty-note {
        padding: 1.25rem;
    }

    .kiwanisty-title {
        font-size: 1.75rem;
    }

    .kiwanisty-memo {
        font-size: 1.45rem;
    }
}

/* Mobile Responsive */
@media screen and (max-width: 480px) {
    .kiwanisty-grid {
        gap: 1rem;
        margin: 1rem 0;
    }

    .kiwanisty-columns-2,
    .kiwanisty-columns-3,
    .kiwanisty-columns-4 {
        grid-template-columns: 1fr;
    }

    .kiwanisty-note {
        padding: 1rem;
    }

    .kiwanisty-title {
        font-size: 1.6rem;
    }

    .kiwanisty-memo {
        font-size: 1.35rem;
        padding: 0.6rem;
    }

    .kiwanisty-pdf-overlay {
        font-size: 0.85rem;
    }

    .kiwanisty-pdf-fallback {
        padding: 2rem 1.5rem;
    }
}

/* PDF Modal */
.kiwanisty-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiwanisty-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.kiwanisty-modal-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.kiwanisty-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 48px;
    height: 48px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiwanisty-modal-close:hover {
    background: #f44336;
    color: #fff;
    transform: scale(1.1);
}

.kiwanisty-modal-close span {
    display: block;
    line-height: 1;
    margin-top: -4px;
}

.kiwanisty-modal-body {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.kiwanisty-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Mobile modal adjustments */
@media screen and (max-width: 768px) {
    .kiwanisty-modal-content {
        width: 95%;
        height: 85%;
    }

    .kiwanisty-modal-close {
        top: -12px;
        right: -12px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

/* Print Styles */
@media print {
    .kiwanisty-note {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .kiwanisty-pdf-overlay {
        display: none;
    }

    .kiwanisty-pdf-thumbnail {
        box-shadow: none;
    }

    .kiwanisty-modal {
        display: none !important;
    }
}
