/*
|--------------------------------------------------------------------------
| SAMRIFA Custom CSS
|--------------------------------------------------------------------------
| Additional utilities and page-specific styles for SAMRIFA Digital Products.
| This file complements glass.css with extra helpers.
|--------------------------------------------------------------------------
*/

/* ==========================================================================
   1. UTILITY OVERRIDES
   ========================================================================== */

/* Force Font Family Override (for CDN Tailwind conflicts) */
.font-display,
.font-heading {
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

.font-body,
.font-text {
    font-family: 'Quicksand', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   2. AUTH PAGE STYLES
   ========================================================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo img {
    height: 48px;
    width: auto;
}

.auth-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.oauth-btn:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.oauth-btn img {
    width: 1.25rem;
    height: 1.25rem;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ==========================================================================
   3. PREVIEW MODAL
   ========================================================================== */

.preview-modal {
    max-width: 1200px;
    width: 95%;
    height: 90vh;
}

.preview-frame {
    width: 100%;
    height: calc(90vh - 80px);
    border: none;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    background: white;
}

/* ==========================================================================
   4. CHECKOUT PAGE
   ========================================================================== */

.checkout-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: calc(var(--navbar-height) + 1rem);
}

.checkout-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.checkout-item:last-child {
    border-bottom: none;
}

.checkout-item-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--bg-content);
}

.checkout-total {
    padding-top: 1rem;
    border-top: 2px solid var(--border-medium);
    margin-top: 1rem;
}

/* Bank Transfer Info */
.bank-info {
    background: var(--bg-hover);
    border: 1px solid var(--border-accent-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.bank-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.bank-info-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.bank-info-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   5. COURSE/CLASS STYLES
   ========================================================================== */

.lesson-list {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.lesson-item:last-child {
    border-bottom: none;
}

.lesson-item:hover {
    background: var(--bg-hover);
}

.lesson-item.completed {
    background: var(--bg-active);
}

.lesson-number {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-content);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.lesson-item.completed .lesson-number {
    background: var(--primary-500);
    color: white;
}

.lesson-item.current .lesson-number {
    background: var(--accent);
    color: white;
}

.lesson-title {
    flex: 1;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.lesson-duration {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Video Player Container */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   6. INVOICE/PDF STYLES
   ========================================================================== */

.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-500);
}

.invoice-logo img {
    height: 40px;
}

.invoice-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-600);
    text-transform: uppercase;
}

.invoice-meta {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.invoice-table {
    width: 100%;
    margin: 2rem 0;
}

.invoice-table th {
    background: var(--primary-50);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-700);
    border-bottom: 1px solid var(--primary-200);
}

.invoice-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.invoice-totals {
    margin-left: auto;
    max-width: 300px;
}

.invoice-totals tr:last-child {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-600);
}

/* ==========================================================================
   7. UPLOAD BUKTI TRANSFER
   ========================================================================== */

.upload-proof {
    max-width: 400px;
}

.proof-preview {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: var(--bg-content);
}

.proof-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* ==========================================================================
   8. RICH TEXT EDITOR CONTENT
   ========================================================================== */

.rich-content {
    line-height: 1.7;
    color: var(--text-primary);
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.rich-content p {
    margin-bottom: 1em;
}

.rich-content ul,
.rich-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.rich-content li {
    margin-bottom: 0.5em;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1em 0;
}

.rich-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5em 0;
    color: var(--text-secondary);
    font-style: italic;
}

.rich-content code {
    background: var(--bg-content);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875em;
}

.rich-content pre {
    background: var(--bg-content);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1em 0;
}

.rich-content pre code {
    background: none;
    padding: 0;
}

/* ==========================================================================
   9. FEATURED SECTION
   ========================================================================== */

.featured-section {
    padding: 4rem 0;
}

.featured-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.featured-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* ==========================================================================
   10. TRUST SECTION
   ========================================================================== */

.trust-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .trust-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.trust-stat {
    text-align: center;
    padding: 1.5rem;
}

.trust-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-600);
    font-family: 'Poppins', sans-serif !important;
}

.trust-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==========================================================================
   11. TESTIMONIAL CARD
   ========================================================================== */

.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.testimonial-stars {
    color: #fbbf24;
    margin-bottom: 0.75rem;
}

.testimonial-content {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.testimonial-author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.testimonial-author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.testimonial-author-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   12. LOADING STATES
   ========================================================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   13. SAFE AREA PADDING
   ========================================================================== */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .safe-area-bottom {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   14. FILTER BAR
   ========================================================================== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    background: var(--bg-content);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-primary);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--accent);
    outline: none;
}
