/**
 * WPBookPress Admin SPA Styles - Premium Light Design
 * Scoped to .wpbp-admin-viewport
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

.wpbp-admin-viewport {
    all: initial;
    display: block;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    min-height: calc(100vh - 40px);
    margin: 20px 20px 0 0;
    color: #334155;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    overflow: hidden;
    position: relative;
}

.wpbp-admin-viewport * {
    box-sizing: border-box;
}

.wpbp-admin-viewport::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 300px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08), transparent);
    pointer-events: none;
    z-index: 0;
}

.wpbp-admin-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.wpbp-logo img {
    height: 35px;
    width: auto;
    display: block;
}

.wpbp-admin-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.wpbp-admin-nav a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wpbp-admin-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; width: 0%; height: 2px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.wpbp-admin-nav a:hover, .wpbp-admin-nav a.active {
    color: #0f172a;
}

.wpbp-admin-nav a:hover::after, .wpbp-admin-nav a.active::after {
    width: 100%;
}

.wpbp-admin-main {
    padding: 2.5rem;
    position: relative;
    z-index: 10;
}

.wpbp-loader {
    display: flex;
    justify-content: center;
    padding: 4rem;
    color: #7c3aed;
    font-weight: 500;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Dashboard Grid */
.wpbp-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.wpbp-stat-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wpbp-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wpbp-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}

.wpbp-stat-card:hover::before {
    opacity: 1;
}

.wpbp-stat-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wpbp-stat-value {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

/* Layout Utilities */
.wpbp-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.wpbp-view-header h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.wpbp-admin-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.wpbp-mb-2 { margin-bottom: 2rem; }

/* Form Styles */
.wpbp-form-group {
    margin-bottom: 1.5rem;
}

.wpbp-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #475569;
}

.wpbp-input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.wpbp-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

textarea.wpbp-input {
    min-height: 100px;
    resize: vertical;
}

.wpbp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.wpbp-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: #475569;
    font-size: 0.95rem;
}

/* Buttons */
.wpbp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
}

.wpbp-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.wpbp-btn-primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.2);
}

.wpbp-btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.3);
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
    border: none;
    color: white;
}

.wpbp-form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Table Styles */
.wpbp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.wpbp-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    letter-spacing: 0.05em;
}

.wpbp-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
    color: #334155;
    vertical-align: middle;
}

.wpbp-table tr:last-child td {
    border-bottom: none;
}

.wpbp-table tbody tr {
    transition: background-color 0.2s;
}

.wpbp-table tbody tr:hover {
    background-color: #f8fafc;
}

.wpbp-btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Badges */
.wpbp-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4f46e5;
}

/* Image Picker */
.wpbp-image-picker {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}
.wpbp-image-preview img {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Modal */
.wpbp-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.wpbp-modal-content {
    background: #fff;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: wpbp-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.wpbp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.wpbp-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}
.wpbp-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}
.wpbp-modal-close:hover {
    color: #0f172a;
}
.wpbp-modal-body {
    padding: 1.5rem;
}
.wpbp-modal-body div strong {
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.wpbp-modal-body div p {
    margin: 0.25rem 0 1rem 0;
    font-size: 1rem;
    color: #0f172a;
    font-weight: 500;
}
.wpbp-modal-footer {
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-end;
}
@keyframes wpbp-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Badge Success override */
.wpbp-badge-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}
