/* 
 * Cleanup CSS
 * Styles extracted from inline HTML attributes for better maintainability and linter compliance.
 */

/* Browser Warning */
#browser-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-family: sans-serif;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#browser-warning a {
    color: #fef08a;
    text-decoration: underline;
    margin-left: 8px;
}

#browser-warning button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 12px;
}

.user-sync-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* Sidebar & Brand */
.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.beta-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #ec4899);
    color: white;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.sidebar-legal-links {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.7rem;
    padding-left: 4px;
}

.sidebar-legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.sidebar-legal-links a:hover {
    color: var(--text-primary) !important;
    /* Force override inline-like behavior */
}

/* Common Layout */
.content-max-width {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.content-max-width.limit-width-only {
    width: auto;
    margin: 0;
}

/* Dashboard Controls */
.limit-warning {
    display: none;
    margin-top: 12px;
}

.dashboard-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 15px;
    padding: 0 5px;
}

.dashboard-control-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.dashboard-control-header h3 i {
    vertical-align: middle;
    margin-right: 6px;
}

.mobile-collapse-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
}

/* Stats */
.stat-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label-flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ri-wallet-mobile {
    display: none;
    color: var(--accent);
    font-size: 1.1em;
}

.next-date-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Notification Header in Dashboard */
.notify-header {
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.notify-desc {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.8rem;
}

/* Settings Sections */
.settings-section-padded {
    padding: 16px;
}

.settings-section-header {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.settings-section-desc {
    font-size: 0.75rem;
    margin-bottom: 10px;
}

.email-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

#notify-email {
    flex: 1;
}

.btn-verify-email {
    display: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#email-verified-badge {
    display: none;
    color: #10b981;
    font-size: 1.2rem;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#email-verification-group {
    display: none;
    gap: 8px;
    align-items: center;
}

#verification-code {
    width: 80px;
    text-align: center;
    letter-spacing: 2px;
}

.btn-confirm-code {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-cancel-code {
    padding: 6px;
    font-size: 0.8rem;
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
}

.telegram-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}

/* Sync Section */
.sync-section-wrapper {
    margin-top: 12px;
    padding: 14px;
}

.sync-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.sync-privacy {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 16px;
    text-align: center;
}

/* Testing Section */
.testing-section-wrapper {
    margin-top: 12px;
}

.testing-desc {
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.testing-buttons-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-test-notify {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.85rem;
}

#notify-status {
    margin-top: 10px;
    padding: 10px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    font-size: 0.8rem;
    display: none;
}

/* Add Subscription Modal */
.sub-name-input-wrapper {
    position: relative;
}

#sub-name {
    padding-right: 48px;
}

.suggestions-dropdown {
    display: none;
}

#modal-sub-icon-preview {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

.note-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.note-label-row label {
    margin-bottom: 0;
}

.note-char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Notification Settings Panel in Modal */
.notification-settings-panel {
    margin-top: 16px;
    margin-bottom: 24px;
}

.notification-settings-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.ns-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
}

#sub-reminder-row {
    display: none;
}

.custom-days-row-nomargin {
    margin: 0;
}

.form-group-spaced {
    margin-bottom: 16px;
}

/* Budget Modal */
.modal-content-xs {
    max-width: 420px;
}

.modal-content-sm {
    max-width: 480px;
}

.modal-content-delete {
    max-width: 400px;
    text-align: center;
}

.modal-content-tag {
    max-width: 350px;
}

.budget-header-wrapper {
    text-align: center;
    margin-bottom: 24px;
}

.budget-icon-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
}

.budget-title {
    margin: 0 0 8px;
}

.budget-desc {
    color: var(--text-secondary);
    margin: 0;
}

.budget-hint-wrapper {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 12px 0 0;
    text-align: center;
}

.modal-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-modal-cancel {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    margin: 0;
    justify-content: center;
}

.btn-modal-save {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    margin: 0;
}

.modal-actions-center {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

/* Cancel Modal */
.cancel-icon-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
}

.cancel-service-name {
    color: var(--accent);
    margin: 0;
    font-weight: 600;
}

.cancel-direct-link {
    display: none;
}

.cancel-email-section {
    display: none;
    margin-top: 16px;
}

.cancel-email-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.cancel-email-textarea {
    width: 100%;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    resize: none;
}

.btn-copy-email {
    margin-top: 8px;
    width: 100%;
}

.btn-got-it {
    margin-top: 24px;
    width: 100%;
}

/* Delete Modal */
.delete-icon-circle {
    width: 60px;
    height: 60px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #ef4444;
    font-size: 2rem;
}

.delete-title {
    margin-bottom: 8px;
}

.delete-message {
    color: var(--text-secondary);
    margin: 0;
}

.delete-sub-name-display {
    color: white;
    font-weight: 600;
    margin-top: 12px;
    font-size: 1.1rem;
}

.btn-delete-confirm {
    flex: 1;
    background: #ef4444;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-delete .btn-secondary {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-tag-confirm {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.delete-tag-msg {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Icon Picker */
.picker-header span {
    font-weight: 600;
    font-size: 1rem;
}

.picker-close-btn {
    width: 28px;
    height: 28px;
}

.picker-text-input {
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.font-chip.font-inter {
    font-family: 'Inter', sans-serif;
}

.font-chip.font-playfair {
    font-family: 'Playfair Display', serif;
}

.font-chip.font-roboto {
    font-family: 'Roboto Mono', monospace;
}

.font-chip.font-dancing {
    font-family: 'Dancing Script', cursive;
}

/* New Utilities for Linter Resolution */
.hidden {
    display: none !important;
}

.w-full-h-full-contain {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mt-12 {
    margin-top: 12px;
}

.mt-32 {
    margin-top: 32px;
}


.mb-20 {
    margin-bottom: 20px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mb-40 {
    margin-bottom: 40px;
}

.p-lock-btn {
    padding: 8px 10px;
}

.text-amber {
    color: #f59e0b;
}

.text-sec-mb-24 {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.opacity-1 {
    opacity: 1 !important;
}

/* Specific Components */
.budget-container {
    display: none;
}

.budget-container.active {
    display: block;
}

.budget-progress-fill.w-0 {
    width: 0;
}

.market-ticker-wrapper {
    display: none;
}

/* Sync Calendar Panel with Sidebar Gray */
.calendar-day-panel {
    background: #111827 !important;
    /* Forces solid dark gray matching sidebar */
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

#calendar-day-panel .sub-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.calendar-day-panel-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
}

/* Elongated Glow for ALL Icons (Logos, Symbols, Apple, etc.) */
.calendar-day-sub-item .sub-icon-outer,
.calendar-day-sub-item .sub-icon-outer>div {
    box-shadow: 0 0 15px -2px var(--accent), 0 0 35px -5px var(--accent) !important;
    overflow: hidden !important;
    border: none !important;
    /* Clean glow bleed */
}

.calendar-day-sub-item .sub-icon-outer img,
.calendar-day-sub-item .sub-icon-outer i,
.calendar-day-sub-item .sub-icon-outer span,
.calendar-day-sub-item .sub-icon-outer .service-icon-text {
    filter: drop-shadow(0 0 15px var(--accent)) !important;
    overflow: visible !important;
}

.sync-actions {
    display: none;
}

#picker-content-text {
    display: none;
}

.limit-warning {
    display: none;
    margin-top: 12px;
}

.limit-warning.visible {
    display: flex;
}

.service-collapsible-content {
    display: block;
}

/* Default */
.pro-offers-collapse-btn {
    margin-left: 12px;
    background: transparent;
    border: none;
    color: #ff4757;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Final Mobile Header Fix (Forced) */
@media (max-width: 768px) {
    body:not(.light-theme) .mobile-header {
        background: #111827 !important;
        /* Forces solid dark gray matching sidebar */
        background-color: #111827 !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: none !important;
        /* Removed the light bottom line */
        border-bottom: none !important;
    }

    .brand-mobile {
        gap: 2px !important;
        /* Minimal gap between JayLex and BETA */
    }

    .brand-mobile .beta-badge {
        font-size: 0.4rem !important;
        /* Extremely small as requested */
        padding: 1px 3px !important;
        margin-left: 0 !important;
        /* No extra margin */
        margin-right: 0 !important;
        vertical-align: middle;
        position: relative;
        top: -2px;
        /* Adjusted visual alignment for smaller size */
    }

    body:not(.light-theme) .mobile-header::before,
    body:not(.light-theme) .mobile-header::after {
        display: none !important;
        content: none !important;
    }
}

/* Enhanced Close Button Animation */
.close-btn,
.close-day-panel {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.close-btn:hover,
.close-day-panel:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #ff4d4d !important;
    transform: rotate(180deg) scale(1.1) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4) !important;
}

.close-btn:active,
.close-day-panel:active {
    transform: rotate(180deg) scale(0.9) !important;
}

/* --- LIGHT THEME CONTRAST PATCHES --- */

/* App-wide Price & Date fixes */
body.light-theme .next-date-label,
body.light-theme .next-date-text,
body.light-theme .sub-price,
body.light-theme .sub-price div,
body.light-theme .sub-price small,
body.light-theme .calendar-day-sub-item .sub-price-block div:first-child {
    color: #0f172a !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

body.light-theme .next-date-label,
body.light-theme .next-date-text,
body.light-theme .sub-details p,
body.light-theme .sub-details div,
body.light-theme .sub-details span:not(.badge) {
    color: #475569 !important;
    opacity: 1 !important;
}

/* Calendar Day Panel Fixes */
body.light-theme .calendar-day-sub-item .sub-details h4 {
    color: #0f172a !important;
}

body.light-theme .calendar-day-sub-item .expand-chevron {
    color: #0f172a !important;
    opacity: 1 !important;
}

body.light-theme .calendar-day-sub-item .calendar-day-sub-expanded .sub-actions-group button,
body.light-theme .calendar-day-sub-item .calendar-day-sub-expanded .sub-actions-group .neon-action-btn,
body.light-theme .calendar-day-sub-item .calendar-day-sub-expanded .sub-actions-group .bell-indicator {
    background: rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}

/* Analytics Cards Fixes */
body.light-theme .analytics-card h4 {
    color: #0f172a !important;
}

body.light-theme .analytics-card .sub-price {
    color: #0f172a !important;
}