/* ==========================================================================
   Axis Canva Shop — Styles v2
   The Agency brand palette integrated.
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
    /* Brand */
    --acs-gold:      #C9A96E;
    --acs-charcoal:  #1C1C1E;
    --acs-cream:     #F8F5F0;
    --acs-mid:       #8B8680;

    /* Primary accent (purple kept for admin vibes, gold used for highlights) */
    --acs-primary:       #C9A96E;
    --acs-primary-hover: #b8904e;
    --acs-secondary:     #F0EDEA;
    --acs-secondary-hover: #E5E0D8;

    /* Text / UI */
    --acs-text:         #1C1C1E;
    --acs-text-muted:   #8B8680;
    --acs-border:       #E0D8D0;
    --acs-bg:           #FFFFFF;

    /* Shape */
    --acs-radius:    12px;
    --acs-radius-sm: 8px;
    --acs-radius-xs: 4px;
    --acs-shadow:      0 2px 8px rgba(28,28,30,0.06);
    --acs-shadow-hover:0 8px 24px rgba(28,28,30,0.12);
    --acs-transition:  0.22s ease;
}

/* ---------- Box-sizing reset ---------- */
.acs-shop-wrap *,
.acs-content-wrap *,
.acs-modal * {
    box-sizing: border-box;
}

/* ==========================================================================
   Notices
   ========================================================================== */
.acs-notice {
    padding: 12px 18px;
    border-radius: var(--acs-radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.acs-notice-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.acs-notice-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.acs-notice-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ==========================================================================
   Canva Connect Banner
   ========================================================================== */
.acs-canva-connect-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--acs-cream);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    padding: 18px 24px;
    margin-bottom: 28px;
}

.acs-canva-connect-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.acs-canva-connect-content strong {
    display: block;
    font-size: 15px;
    color: var(--acs-text);
    margin-bottom: 2px;
}

.acs-canva-connect-content p {
    margin: 0;
    font-size: 13px;
    color: var(--acs-text-muted);
}

.acs-canva-connected-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #155724;
    background: #d4edda;
    border-radius: 20px;
    padding: 4px 12px;
    margin-bottom: 20px;
}

.acs-dot-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    display: inline-block;
}

/* ==========================================================================
   Shop Header
   ========================================================================== */
.acs-shop-header,
.acs-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.acs-shop-title,
.acs-content-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--acs-text);
    letter-spacing: -0.02em;
}

.acs-shop-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.acs-shop-controls input,
.acs-shop-search input {
    padding: 9px 14px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    font-size: 14px;
    min-width: 220px;
    transition: border-color var(--acs-transition);
    color: var(--acs-text);
}

.acs-shop-controls input:focus,
.acs-shop-search input:focus {
    outline: none;
    border-color: var(--acs-gold);
}

.acs-content-filter select {
    padding: 8px 14px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    font-size: 14px;
    background: #fff;
    color: var(--acs-text);
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.acs-loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--acs-text-muted);
}

.acs-loading-state p { margin-top: 12px; font-size: 14px; }

/* ==========================================================================
   Grid
   ========================================================================== */
.acs-shop-grid,
.acs-content-grid {
    display: grid;
    grid-template-columns: repeat(var(--acs-columns, 3), 1fr);
    gap: 24px;
}

@media (max-width: 991px) {
    .acs-shop-grid,
    .acs-content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .acs-shop-grid,
    .acs-content-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Template Pack Card
   ========================================================================== */
.acs-template-card {
    background: var(--acs-bg);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--acs-transition), transform var(--acs-transition), border-color var(--acs-transition);
    cursor: pointer;
}

.acs-template-card:hover {
    box-shadow: var(--acs-shadow-hover);
    transform: translateY(-3px);
    border-color: var(--acs-gold);
}

.acs-template-thumb {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    background: var(--acs-cream);
    overflow: hidden;
}

.acs-template-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.acs-template-card:hover .acs-template-thumb img {
    transform: scale(1.04);
}

.acs-template-thumb-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--acs-text-muted);
    font-size: 13px;
    background: linear-gradient(135deg, #f0ece7 0%, #e8e2da 100%);
}

/* Mini thumbnails strip for packs with multiple templates */
.acs-pack-thumbs {
    position: absolute;
    bottom: 8px; left: 8px;
    display: flex;
    gap: 4px;
}

.acs-pack-thumbs-badge {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid rgba(255,255,255,0.8);
    overflow: hidden;
    background: var(--acs-cream);
}

.acs-pack-thumbs-badge img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.acs-template-info {
    padding: 14px 16px 8px;
    flex: 1;
}

.acs-template-category {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--acs-gold);
    font-weight: 700;
    margin-bottom: 5px;
}

.acs-template-name {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--acs-text);
    line-height: 1.3;
}

.acs-template-count {
    font-size: 12px;
    color: var(--acs-text-muted);
}

.acs-create-btn {
    margin: 0 16px 16px;
    width: calc(100% - 32px);
}

/* ==========================================================================
   Content Card (My Designs)
   ========================================================================== */
.acs-content-card {
    background: var(--acs-bg);
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--acs-transition);
}

.acs-content-card:hover {
    box-shadow: var(--acs-shadow-hover);
}

.acs-content-thumb {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    background: var(--acs-cream);
    overflow: hidden;
}

.acs-content-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.acs-content-thumb-placeholder {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--acs-text-muted);
    font-size: 13px;
    background: linear-gradient(135deg, #f0ece7 0%, #e8e2da 100%);
}

/* Status Badges */
.acs-status-badge {
    position: absolute;
    top: 10px; right: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acs-status-completed,
.acs-status-done       { background: #d4edda; color: #155724; }
.acs-status-autofill,
.acs-status-export,
.acs-status-pending    { background: #fff3cd; color: #856404; }
.acs-status-failed     { background: #f8d7da; color: #721c24; }

.acs-content-info {
    padding: 14px 16px 6px;
    flex: 1;
}

.acs-content-name {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--acs-text);
}

.acs-content-date {
    font-size: 12px;
    color: var(--acs-text-muted);
}

.acs-status-message {
    margin: 6px 0 0;
    font-size: 12px;
    color: #721c24;
}

.acs-content-actions {
    padding: 8px 16px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Empty state */
.acs-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--acs-text-muted);
}

.acs-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.35;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.acs-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.acs-page-btn {
    padding: 7px 14px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-xs);
    background: var(--acs-bg);
    font-size: 14px;
    cursor: pointer;
    color: var(--acs-text);
    transition: background var(--acs-transition), border-color var(--acs-transition);
}

.acs-page-btn:hover,
.acs-page-btn.is-active {
    background: var(--acs-gold);
    border-color: var(--acs-gold);
    color: #fff;
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.acs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--acs-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background var(--acs-transition), box-shadow var(--acs-transition), opacity var(--acs-transition);
    line-height: 1.4;
    gap: 6px;
}

.acs-btn-sm { padding: 6px 14px; font-size: 13px; }

.acs-btn-primary         { background: var(--acs-gold); color: #fff; }
.acs-btn-primary:hover   { background: var(--acs-primary-hover); color: #fff; text-decoration: none; }

.acs-btn-secondary       { background: var(--acs-secondary); color: var(--acs-text); }
.acs-btn-secondary:hover { background: var(--acs-secondary-hover); color: var(--acs-text); text-decoration: none; }

.acs-btn-outline         { background: transparent; color: var(--acs-gold); border: 1.5px solid var(--acs-gold); }
.acs-btn-outline:hover   { background: var(--acs-gold); color: #fff; }

.acs-btn:disabled, .acs-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ==========================================================================
   Modal
   ========================================================================== */
.acs-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(28, 28, 30, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.acs-modal {
    background: var(--acs-bg);
    border-radius: var(--acs-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(28, 28, 30, 0.22);
    animation: acsSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes acsSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.acs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--acs-border);
    position: sticky;
    top: 0;
    background: var(--acs-bg);
    z-index: 10;
}

.acs-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--acs-text);
}

.acs-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--acs-text-muted);
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--acs-transition);
}

.acs-modal-close:hover {
    background: var(--acs-secondary);
    color: var(--acs-text);
}

.acs-modal-body { padding: 24px; }

/* Loading inside modal */
.acs-loading {
    text-align: center;
    padding: 40px 20px;
}

.acs-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--acs-border);
    border-top-color: var(--acs-gold);
    border-radius: 50%;
    animation: acsSpin 0.7s linear infinite;
    margin: 0 auto 12px;
    display: block;
}

@keyframes acsSpin {
    to { transform: rotate(360deg); }
}

/* Pack Description */
.acs-pack-description {
    font-size: 14px;
    color: var(--acs-text-muted);
    margin: 0 0 16px;
}

/* Mini template list inside modal */
.acs-templates-mini-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.acs-mini-template {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--acs-text-muted);
    max-width: 80px;
    text-align: center;
}

.acs-mini-template img {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--acs-border);
}

.acs-mini-template-thumb-placeholder {
    width: 72px;
    height: 48px;
    background: var(--acs-cream);
    border: 1px solid var(--acs-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--acs-text-muted);
}

/* ==========================================================================
   Form Fields
   ========================================================================== */
.acs-field-group {
    margin-bottom: 18px;
}

.acs-field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--acs-text);
    margin-bottom: 6px;
}

.acs-field-group input[type="text"],
.acs-field-group input[type="email"],
.acs-field-group input[type="url"],
.acs-field-group input[type="number"],
.acs-field-group input[type="date"],
.acs-field-group input[type="color"],
.acs-field-group textarea,
.acs-field-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--acs-border);
    border-radius: var(--acs-radius-sm);
    font-size: 14px;
    color: var(--acs-text);
    transition: border-color var(--acs-transition);
    background: #fff;
}

.acs-field-group input:focus,
.acs-field-group textarea:focus,
.acs-field-group select:focus {
    outline: none;
    border-color: var(--acs-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15);
}

.acs-field-group textarea { min-height: 80px; resize: vertical; }

.acs-field-hint {
    font-size: 12px;
    color: var(--acs-text-muted);
    margin-top: 4px;
}

.acs-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--acs-border);
}

/* ==========================================================================
   Result (modal success / error)
   ========================================================================== */
.acs-result-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #d4edda;
    color: #155724;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.acs-result-icon.error {
    background: #f8d7da;
    color: #721c24;
}

#acs-modal-result {
    text-align: center;
    padding: 10px 0;
}

#acs-modal-result p {
    font-size: 15px;
    color: var(--acs-text);
    margin-bottom: 12px;
}

#acs-result-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ==========================================================================
   Login notice / Error / Empty
   ========================================================================== */
.acs-login-notice {
    padding: 20px;
    background: var(--acs-cream);
    border-radius: var(--acs-radius-sm);
    text-align: center;
    color: var(--acs-text-muted);
}

.acs-error {
    padding: 20px;
    background: #fff3f3;
    border: 1px solid #fcc;
    border-radius: var(--acs-radius-sm);
    color: #c33;
    text-align: center;
}

.acs-hidden { display: none !important; }

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */
@media (max-width: 600px) {
    .acs-canva-connect-banner { flex-direction: column; }
    .acs-canva-connect-banner .acs-btn { width: 100%; }
    .acs-modal { max-height: 95vh; }
    .acs-shop-controls input { min-width: 160px; }
}
