/* ============================================================
   Planify Digital Assets — Frontend Stylesheet
   ============================================================ */

/* ----- Grid ----- */
.planify-asset-library,
.planify-featured { width: 100%; }

.planify-asset-grid {
    display: grid;
    gap: 24px;
    margin: 20px 0;
}
.planify-grid-1 { grid-template-columns: 1fr; }
.planify-grid-2 { grid-template-columns: repeat(2, 1fr); }
.planify-grid-3 { grid-template-columns: repeat(3, 1fr); }
.planify-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .planify-grid-3, .planify-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .planify-grid-2, .planify-grid-3, .planify-grid-4 { grid-template-columns: 1fr; }
}

/* ----- Card ----- */
.planify-asset-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.planify-asset-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    transform: translateY(-2px);
}
.planify-asset-card.planify-locked {
    opacity: .92;
}

.planify-asset-thumbnail {
    position: relative;
    background: #f3f4f6;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.planify-asset-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.planify-asset-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f4fd 0%, #d1e9fb 100%);
}

/* ----- Badges ----- */
.planify-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.planify-badge-free     { background: #22c55e; color: #fff; }
.planify-badge-unlocked { background: #3b82f6; color: #fff; }
.planify-badge-locked   { background: #6b7280; color: #fff; }

/* ----- Card Body ----- */
.planify-asset-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.planify-asset-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}
.planify-asset-title a { color: inherit; text-decoration: none; }
.planify-asset-title a:hover { color: #2271b1; }

.planify-asset-excerpt {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.planify-asset-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.planify-file-type,
.planify-version,
.planify-required-plan {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.planify-file-type        { background: #eff6ff; color: #1d4ed8; }
.planify-version          { background: #f0fdf4; color: #15803d; }
.planify-required-plan    { background: #fef9c3; color: #854d0e; }

/* ----- Action buttons ----- */
.planify-asset-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.planify-btn {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .15s, opacity .15s;
}
.planify-btn-download { background: #2271b1; color: #fff; }
.planify-btn-download:hover { background: #135e96; color: #fff; }
.planify-btn-upgrade  { background: #f59e0b; color: #fff; }
.planify-btn-upgrade:hover { background: #d97706; color: #fff; }
.planify-btn-login    { background: #6b7280; color: #fff; }
.planify-btn-login:hover { background: #374151; color: #fff; }
.planify-btn-preview  { background: transparent; color: #2271b1; border: 1px solid #2271b1; }
.planify-btn-preview:hover { background: #eff6ff; color: #1d4ed8; }
.planify-btn-primary  { background: #2271b1; color: #fff; }

.planify-locked-msg {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    flex: 0 0 100%;
}

/* ----- Filters ----- */
.planify-asset-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}
.planify-search-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    min-width: 200px;
}
.planify-filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
}
.planify-filter-btn {
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.planify-filter-btn:hover { background: #135e96; }

/* ----- No results ----- */
.planify-no-assets {
    padding: 24px;
    text-align: center;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

/* ----- My Assets Dashboard ----- */
.planify-my-assets { max-width: 900px; }
.planify-my-subscription-summary { margin-bottom: 24px; }
.planify-sub-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}
.planify-plan-name { font-weight: 700; font-size: 15px; }
.planify-status-active { color: #16a34a; font-weight: 600; }
.planify-days-left, .planify-renewal { font-size: 13px; color: #6b7280; }

.planify-download-quota { margin: 12px 0; }
.planify-quota-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}
.planify-quota-fill {
    height: 100%;
    background: #2271b1;
    border-radius: 4px;
    transition: width .4s;
}

.planify-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}
.planify-history-table th,
.planify-history-table td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
}
.planify-history-table th { background: #f9fafb; font-weight: 600; }

/* ----- Download error notice ----- */
.planify-download-error-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #dc2626;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    z-index: 9999;
    font-size: 13px;
    max-width: 320px;
    animation: planify-fadein .3s ease;
}
@keyframes planify-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ----- File type icon placeholders ----- */
.planify-type-pdf        { color: #dc2626; }
.planify-type-excel      { color: #16a34a; }
.planify-type-gsheet     { color: #16a34a; }
.planify-type-notion     { color: #111827; }
.planify-type-design     { color: #7c3aed; }
.planify-type-zip        { color: #92400e; }
.planify-type-other      { color: #6b7280; }

/* ----- Admin log page helpers ----- */
.planify-status-success { color: #16a34a; font-weight: 600; }
.planify-status-failed  { color: #dc2626; font-weight: 600; }

/* ----- My Library Tab (My Account) ----- */
.planify-my-library-tab { max-width: 860px; }

.planify-library-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.planify-library-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}
.planify-library-plan-badge {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
}
.planify-library-cta {
    margin-left: auto;
}

.planify-library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}
.planify-library-search,
.planify-library-type-select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}
.planify-library-search { min-width: 200px; flex: 1; }
.planify-library-reset {
    font-size: 13px;
    color: #6b7280;
    text-decoration: underline;
}
.planify-library-filter-btn { height: 40px; }

.planify-library-empty {
    padding: 40px 0;
    text-align: center;
    color: #6b7280;
}

/* ----- Library list ----- */
.planify-library-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.planify-library-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    transition: background .15s;
}
.planify-library-item:last-child { border-bottom: none; }
.planify-library-item:hover { background: #f9fafb; }
.planify-library-item.planify-lib-locked { opacity: .85; }

.planify-library-item-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}
.planify-library-item-icon {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.planify-library-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.planify-library-item-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.planify-library-item-title a {
    color: inherit;
    text-decoration: none;
}
.planify-library-item-title a:hover { text-decoration: underline; }

.planify-library-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.planify-library-item-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Use theme button sizing — no color overrides */
.planify-lib-btn {
    white-space: nowrap;
    font-size: 13px;
    padding: 7px 16px;
    text-decoration: none !important;
}

.planify-library-pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.planify-library-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    color: #374151;
    background: #fff;
    transition: background .15s;
}
.planify-library-pagination .page-numbers.current,
.planify-library-pagination .page-numbers:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

@media (max-width: 600px) {
    .planify-library-item { flex-wrap: wrap; }
    .planify-library-item-action { width: 100%; }
}
