/* ==============================================
   GoodMood Shared Components
   Cards, Buttons, Badges, Stats, Gauges, Sections,
   Banners, Loading, Breadcrumb, Empty State
   ============================================== */

/* --- Cards (Elementor pricing style) --- */
.gm-card {
    background-color: var(--gm-color-white);
    background-image: var(--gm-gradient-default);
    border-radius: var(--gm-radius);
    padding: 10px;
    border: 1px solid var(--gm-color-border);
    transition: var(--gm-transition);
}
.gm-card-inner { padding: 9%; }
.gm-card.gm-card-popular { background-image: var(--gm-gradient-popular); }
.gm-card.gm-card-popular .gm-popular-badge {
    display: inline-block; background: var(--gm-color-primary); color: white;
    font-family: var(--gm-font-heading); font-size: 16px; font-weight: 600;
    text-transform: uppercase; line-height: 16px; padding: 3px 15px;
    border-radius: 30px; position: absolute; top: 15px; right: 15px;
}
.gm-card-clickable:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.08); transform: translateY(-2px); text-decoration: none; color: inherit; }
.gm-card-clickable { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.gm-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }

/* --- Stat Cards --- */
.gm-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.gm-stat-card { background: var(--gm-color-white); border-radius: var(--gm-radius); padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 1px solid var(--gm-color-gray); display: flex; align-items: center; gap: 1rem; }
.gm-stat-icon { width: 48px; height: 48px; border-radius: var(--gm-radius); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.gm-stat-icon.blue { background: #dbeafe; color: #1e40af; }
.gm-stat-icon.green { background: #d1fae5; color: #065f46; }
.gm-stat-icon.purple { background: rgba(255,164,78,.12); color: #e8922a; }
.gm-stat-icon.amber { background: #fef3c7; color: #92400e; }
.gm-stat-icon.red { background: #fee2e2; color: #991b1b; }
.gm-stat-value { font-family: var(--gm-font-heading); font-size: 1.5rem; font-weight: 700; color: var(--gm-color-dark); line-height: 1.2; }
.gm-stat-label { font-size: 0.8125rem; color: var(--gm-color-text); }

/* --- Badges --- */
.gm-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.025em; }
.gm-badge-active { background: #d1fae5; color: #065f46; }
.gm-badge-suspended { background: #fef3c7; color: #92400e; }
.gm-badge-cancelled { background: #fee2e2; color: #991b1b; }
.gm-badge-included { background: #3b82f6; color: white; }
.gm-badge-coming { background: #f3f4f6; color: #6b7280; }
.gm-badge-freemium { background: #fef3c7; color: #92400e; }
.gm-badge-owned { background: #d1fae5; color: #065f46; }
.gm-badge-monthly { background: #fff3e0; color: #e8922a; }

.gm-badge-expiring { background: #fef3c7 !important; color: #92400e !important; font-size: 0.6875rem; padding: 3px 8px; border-radius: 999px; font-weight: 600; display: inline-flex; align-items: center; }

/* --- Gauge Bar --- */
.gm-gauge-bar { height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem; }
.gm-gauge-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; background: linear-gradient(90deg, var(--gm-color-primary), var(--gm-color-primary-dark)); }
.gm-gauge-fill.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.gm-gauge-fill.danger { background: linear-gradient(90deg, #ef4444, #dc2626); }
.gm-gauge-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: #6b7280; }
.gm-gauge-labels strong { color: #111827; }
.gm-gauge-pct { font-weight: 600; font-size: 0.8125rem; color: var(--gm-color-primary); }
.gm-gauge-pct.warning { color: #f59e0b; }
.gm-gauge-pct.danger { color: #ef4444; }

/* --- Buttons --- */
.gm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 0.375rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; text-decoration: none; line-height: 1.4; }
.gm-btn-primary { background: #FFA44E; color: white; border-color: #FFA44E; }
.gm-btn-primary:hover { background: #e8922a; border-color: #e8922a; color: white; text-decoration: none; }
.gm-btn-secondary { background: white; color: #374151; border-color: #e5e7eb; }
.gm-btn-secondary:hover { background: #f9fafb; border-color: #d1d5db; color: #111827; text-decoration: none; }
.gm-btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.gm-btn-block { width: 100%; }
.gm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.gm-btn-danger-outline { background: transparent !important; color: #dc2626 !important; border: 1.5px solid #fca5a5 !important; transition: all 0.25s ease !important; }
.gm-btn-danger-outline:hover { background: #fef2f2 !important; color: #991b1b !important; border-color: #ef4444 !important; }
.gm-btn-danger-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.gm-btn-coming { background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb; cursor: default; font-size: 0.75rem; }
.gm-btn-coming:hover { background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb; transform: none; }
.gm-btn-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.gm-btn-warning:hover { background: #fde68a; color: #78350f; border-color: #f59e0b; text-decoration: none; }

/* --- Section Cards --- */
.gm-section { background: white; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 1.5rem; margin-bottom: 1.5rem; }
.gm-section-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.gm-section-header h3 { font-size: 1rem; font-weight: 600; color: #111827; margin: 0 0 0.25rem 0; }
.gm-section-header p { font-size: 0.8125rem; color: #6b7280; margin: 0; }

/* --- Info Banner --- */
.gm-info-banner { display: flex; gap: 1rem; padding: 1.25rem 1.5rem; border-radius: 0.75rem; margin-bottom: 1.5rem; }
.gm-info-banner.blue { background: #eff6ff; border: 1px solid #bfdbfe; }
.gm-info-banner.blue i { color: #2563eb; }
.gm-info-banner.blue strong { color: #1e40af; }
.gm-info-banner.blue p { color: #2563eb; margin: 0; font-size: 0.8125rem; }
.gm-info-banner.green { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); border: 1px solid #a7f3d0; }
.gm-info-banner.green i { color: #10b981; }
.gm-info-banner.green strong { color: #065f46; }
.gm-info-banner.green p { color: #047857; margin: 0; font-size: 0.8125rem; }
.gm-info-banner i { font-size: 1.25rem; flex-shrink: 0; margin-top: 0.125rem; }

/* --- Empty State --- */
.gm-empty-state { text-align: center; padding: 4rem 2rem; }
.gm-empty-icon { width: 80px; height: 80px; background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%); border-radius: 1rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; font-size: 2rem; color: #3b82f6; }
.gm-empty-state h3 { font-size: 1.25rem; font-weight: 600; color: #111827; margin: 0 0 0.5rem 0; }
.gm-empty-state p { font-size: 0.875rem; color: #6b7280; margin: 0 0 1.5rem 0; max-width: 400px; margin-left: auto; margin-right: auto; }

/* --- Loading Spinner --- */
.gm-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; gap: 1rem; }
.gm-spinner { width: 40px; height: 40px; border: 4px solid rgba(255, 164, 78, 0.2); border-top-color: #FFA44E; border-radius: 50%; animation: gm-spin 1s linear infinite; }
@keyframes gm-spin { to { transform: rotate(360deg); } }
.gm-loading-text { font-size: 0.875rem; color: #6b7280; }
.gm-btn.syncing i { animation: gm-spin 1s linear infinite; }

/* --- Login Required --- */
.goodmood-login-required { text-align: center; padding: 3rem 2rem; background: white; border-radius: 0.75rem; border: 1px solid #e5e7eb; max-width: 400px; margin: 2rem auto; margin-top: 120px; }
.goodmood-login-required p { color: #6b7280; margin-bottom: 1rem; }

/* --- Breadcrumb --- */
.gm-breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: #6b7280; margin-bottom: 1rem; flex-wrap: wrap; }
.gm-breadcrumb a { color: #FFA44E; text-decoration: none; transition: color 0.2s; }
.gm-breadcrumb a:hover { color: #e8922a; text-decoration: underline; }
.gm-breadcrumb .separator { color: #d1d5db; font-size: 0.625rem; }
.gm-breadcrumb .current { color: #111827; font-weight: 500; }

/* --- Checkout Banner --- */
.gm-checkout-banner { display: flex; gap: 1rem; padding: 1.25rem 1.5rem; border-radius: 0.75rem; margin-bottom: 1.5rem; align-items: center; animation: gm-slideDown 0.4s ease; }
.gm-checkout-banner.success { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); border: 1px solid #a7f3d0; }
.gm-checkout-banner.success i { color: #10b981; font-size: 1.5rem; }
.gm-checkout-banner.success strong { color: #065f46; }
.gm-checkout-banner.success p { color: #047857; margin: 0; font-size: 0.8125rem; }
.gm-checkout-banner.cancel { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); border: 1px solid #fcd34d; }
.gm-checkout-banner.cancel i { color: #f59e0b; font-size: 1.5rem; }
.gm-checkout-banner.cancel strong { color: #92400e; }
.gm-checkout-banner.cancel p { color: #a16207; margin: 0; font-size: 0.8125rem; }
.gm-checkout-banner .gm-banner-close { margin-left: auto; background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 1.25rem; padding: 0; line-height: 1; }
.gm-checkout-banner .gm-banner-close:hover { color: #6b7280; }
@keyframes gm-slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Welcome --- */
.gm-welcome { font-size: 1.125rem; font-weight: 400; color: #6b7280; margin-bottom: 0.25rem; }
.gm-welcome strong { color: #111827; font-weight: 600; }

/* --- Platform Selector --- */
.gm-platform-selector { position: relative; z-index: 100; }
.gm-page-header-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.gm-ps-trigger { display: inline-flex; align-items: center; gap: 0.5rem; padding: 8px 20px; background: #ffffff; border: 1px solid #EEEEEE; border-radius: 999px; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 0.875rem; font-weight: 500; color: #0E0E0E; cursor: pointer; transition: all 0.3s linear; white-space: nowrap; line-height: 1.5; }
.gm-ps-trigger:hover { background: #0E0E0E; border-color: #0E0E0E; color: #ffffff; }
.gm-ps-trigger:hover i:first-child, .gm-ps-trigger:hover .gm-ps-arrow { color: #ffffff; }
.gm-ps-trigger i:first-child { font-size: 0.75rem; color: #FFA44E; }
.gm-ps-arrow { font-size: 0.625rem; color: #9ca3af; transition: transform 0.2s, color 0.3s; }
.gm-platform-selector.open .gm-ps-arrow { transform: rotate(180deg); }
.gm-platform-selector.open .gm-ps-trigger { background: #0E0E0E; border-color: #0E0E0E; color: #ffffff; }
.gm-platform-selector.open .gm-ps-trigger i:first-child, .gm-platform-selector.open .gm-ps-trigger .gm-ps-arrow { color: #ffffff; }
.gm-ps-dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 280px; background: #ffffff; border: 1px solid #EEEEEE; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,0.1); z-index: 999; padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all 0.2s ease; }
.gm-platform-selector.open .gm-ps-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.gm-ps-dropdown-label { font-size: 0.6875rem; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 12px 4px; }
.gm-ps-option { display: flex; align-items: center; justify-content: flex-start; gap: 0.625rem; width: 100%; padding: 10px 12px; border: none; background: transparent; border-radius: 10px; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 0.875rem; color: #374151; cursor: pointer; text-align: left; transition: all 0.2s; }
.gm-ps-option:hover { background: #f5f5f5; color: #0E0E0E; }
.gm-ps-option.active { background: #FFA44E; color: #ffffff; font-weight: 600; }
.gm-ps-option.active:hover { background: #e8943e; }
.gm-ps-option i:first-child { font-size: 0.75rem; color: #9ca3af; }
.gm-ps-option.active i:first-child { color: #ffffff; }
.gm-ps-check { margin-left: auto; font-size: 0.625rem; color: #FFA44E; }
.gm-ps-option.active .gm-ps-check { color: #ffffff; }
.gm-platform-badge { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.3rem 0.625rem; background: #f3f4f6; border-radius: 0.375rem; font-size: 0.8125rem; color: #374151; font-weight: 500; }
.gm-platform-badge i { font-size: 0.75rem; color: #FFA44E; }
.gm-last-sync { font-size: 0.6875rem; color: #9ca3af; display: flex; align-items: center; gap: 0.25rem; margin-top: 0.25rem; }
.gm-last-sync i { font-size: 0.625rem; }
.gm-pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 1rem 0 0.5rem; }
.gm-pagination button { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 0.5rem; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; font-size: 0.8125rem; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.gm-pagination button:hover:not(:disabled) { background: #f3f4f6; border-color: #d1d5db; }
.gm-pagination button.active { background: #FFA44E; color: #fff; border-color: #FFA44E; }
.gm-pagination button:disabled { opacity: 0.4; cursor: default; }
.gm-pagination-info { font-size: 0.75rem; color: #9ca3af; margin-left: 0.5rem; }
