/* ============================================================
   AccurateAZ Canva EDDM – Frontend Styles
   ============================================================ */

/* ── Grid ─────────────────────────────────────────────────── */
.aaz-gallery-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, 1fr);
    margin: 24px 0;
}
.aaz-cols-2 .aaz-gallery-grid { grid-template-columns: repeat(2, 1fr); }
.aaz-cols-4 .aaz-gallery-grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px)  { .aaz-gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .aaz-gallery-grid { grid-template-columns: 1fr; } }

/* ── Template card ────────────────────────────────────────── */
.aaz-template-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
    display: flex;
    flex-direction: column;
}
.aaz-template-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

.aaz-template-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aaz-template-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aaz-template-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.aaz-template-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
}
.aaz-template-size {
    font-size: .8rem;
    color: #718096;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 999px;
    width: fit-content;
}
.aaz-template-desc {
    font-size: .875rem;
    color: #4a5568;
    margin: 0;
    flex: 1;
}
.aaz-template-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.aaz-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background .2s, color .2s, border-color .2s;
    line-height: 1.4;
}
.aaz-btn--primary {
    background: #6c63ff;
    color: #fff;
    border-color: #6c63ff;
}
.aaz-btn--primary:hover {
    background: #5a52d5;
    border-color: #5a52d5;
    color: #fff;
    text-decoration: none;
}
.aaz-btn--secondary {
    background: #edf2f7;
    color: #4a5568;
    border-color: #edf2f7;
}
.aaz-btn--secondary:hover {
    background: #e2e8f0;
    text-decoration: none;
    color: #2d3748;
}
.aaz-btn--canva {
    background: #7d2ae8;
    color: #fff;
    border-color: #7d2ae8;
}
.aaz-btn--canva:hover {
    background: #6a23c7;
    border-color: #6a23c7;
    color: #fff;
    text-decoration: none;
}
.aaz-btn--outline {
    background: transparent;
    color: #6c63ff;
    border-color: #6c63ff;
}
.aaz-btn--outline:hover {
    background: #6c63ff;
    color: #fff;
    text-decoration: none;
}
.aaz-btn--large  { padding: 12px 28px; font-size: 1rem; }
.aaz-btn--sm     { padding: 5px 12px;  font-size: .8rem; }
.aaz-btn:disabled, .aaz-btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

/* ── Notices ──────────────────────────────────────────────── */
.aaz-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .9rem;
}
.aaz-notice--info    { background: #ebf8ff; border-left: 4px solid #4299e1; color: #2b6cb0; }
.aaz-notice--warning { background: #fffbeb; border-left: 4px solid #f6ad55; color: #744210; }
.aaz-notice--success { background: #f0fff4; border-left: 4px solid #48bb78; color: #276749; }
.aaz-error           { color: #c53030; }

/* ── Connected badge ──────────────────────────────────────── */
.aaz-connected-badge {
    display: inline-block;
    background: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .85rem;
    margin-right: 8px;
}

/* ── Modal ────────────────────────────────────────────────── */
.aaz-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aaz-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}
.aaz-modal-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    padding: 36px 40px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.aaz-modal-box h2 {
    margin: 0 0 12px;
    font-size: 1.4rem;
    color: #1a202c;
}
.aaz-modal-box p {
    color: #4a5568;
    font-size: .95rem;
    margin-bottom: 16px;
}
.aaz-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #a0aec0;
}
.aaz-modal-close:hover { color: #4a5568; }

/* ── Spinner ──────────────────────────────────────────────── */
.aaz-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #7d2ae8;
    border-radius: 50%;
    animation: aaz-spin .7s linear infinite;
    margin: 16px auto;
}
@keyframes aaz-spin { to { transform: rotate(360deg); } }

/* ── My Designs section ───────────────────────────────────── */
.aaz-my-designs h3 {
    margin-bottom: 12px;
    font-size: 1.25rem;
    color: #1a202c;
}

/* ── Note text ────────────────────────────────────────────── */
.aaz-note {
    font-size: .8rem;
    color: #718096;
    margin-top: 8px;
}
