/* ==========================================
   Global Variables & Base Styles
   ========================================== */
:root {
    --primary: #CE4636;
    --primary-hover: #b83a2c;
    --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --bg-solid: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --input-bg: #f8f9fa;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    color: var(--text-main);
}

body.landing-page { background: var(--bg-gradient); }
body.auth-page { background: var(--bg-solid); }

.support-footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
    padding: 30px 20px;
}

.support-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* ==========================================
   Landing Page Specifics
   ========================================== */
.landing-header {
    width: 100%;
    padding: 20px 0;
    text-align: center;
}

.hero {
    text-align: center;
    padding: 30px 20px;
    max-width: 600px;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.btn-subscribe {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(206, 70, 54, 0.3);
    transition: all 0.3s ease;
}

.btn-subscribe:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(206, 70, 54, 0.4);
}

.slider-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.slider-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.slide {
    flex: 0 0 80%;
    max-width: 300px;
    scroll-snap-align: center;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   Auth / Login / Register Page Specifics
   ========================================== */
.auth-header {
    margin-top: 30px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 30px;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.auth-tabs {
    display: flex;
    background: var(--input-bg);
    border-radius: 12px;
    margin-bottom: 25px;
    padding: 5px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.form-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: var(--input-bg);
    font-family: inherit;
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: border 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 20px;
}

.btn-submit:hover {
    background: var(--primary-hover);
}

.forgot-link {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    margin-top: -5px;
    margin-bottom: 20px;
}

.divider {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 20px;
    position: relative;
}

.divider::before, .divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #eee;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.btn-google {
    width: 100%;
    padding: 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.3s;
    box-sizing: border-box;
}

.btn-google:hover { background: #f9f9f9; }

.alert { padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 0.9rem; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #f87171; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }

.bottom-cta {
    text-align: center;
    margin: 20px 0 50px 0;
}

/* ==========================================
   Store Badges (Google Play & App Store)
   ========================================== */
.store-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 10px 0 30px 0;
    flex-wrap: wrap; /* Helps wrap on super small screens */
}

.store-badges a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.store-badges a:hover {
    transform: scale(1.05); /* Slight pop effect on hover */
}

.store-badges img {
    height: 50px; /* Standard badge height */
    width: auto;
    display: block;
}

/* ==========================================
   Dashboard Specifics
   ========================================== */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-solid);
}

.main-content {
    flex: 1;
    padding: 20px 40px;
    overflow-x: hidden;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    margin-bottom: 40px;
}

.burger-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
    display: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
}

.user-info strong { color: var(--text-main); }

.btn-logout {
    background: #ffebee;
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-logout:hover { background: #ffcdd2; }

.page-title {
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

.page-subtext {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 30px;
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 900px;
}

.dash-card {
    background: #fff;
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
}

.dash-card h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.4rem;
    border-bottom: 2px solid #f4f7f6;
    padding-bottom: 12px;
    margin-bottom: 25px;
}

.profile-info p {
    font-size: 1.1rem;
    color: var(--text-main);
    margin: 12px 0;
}
.profile-info strong { color: var(--text-muted); margin-right: 10px; }

/* Dash Alerts */
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 15px 20px; border-radius: 12px; margin-bottom: 25px; font-size: 0.95rem; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; padding: 15px 20px; border-radius: 12px; margin-bottom: 25px; font-size: 0.95rem; }

/* Subscription Box Details */
.sub-details-box { background: var(--bg-solid); border-radius: 16px; padding: 30px; margin-bottom: 30px; border: 1px solid #eaeeec; }
.sub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.sub-title { margin: 0; font-size: 1.2rem; color: var(--text-main); font-weight: 600; }

.badge { padding: 6px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef08a; color: #a16207; }
.badge-expired { background: #fee2e2; color: #dc2626; }

.sub-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 25px; }
.sub-info-item p { margin: 0 0 5px 0; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; font-weight: 500; }
.sub-info-item h4 { margin: 0; font-size: 1.2rem; color: var(--text-main); }

/* Payment Plans */
.section-heading { color: var(--text-main); margin-bottom: 20px; font-size: 1.1rem; }
.plans-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.plan-card { background: #fff; border: 2px solid #f4f7f6; border-radius: 16px; padding: 30px 20px; text-align: center; transition: all 0.3s ease; box-shadow: 0 5px 15px rgba(0,0,0,0.02); }
.plan-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 12px 25px rgba(206, 70, 54, 0.15); }
.plan-title { margin: 0 0 10px 0; font-size: 1.2rem; color: var(--text-muted); font-weight: 500; }
.plan-price { font-size: 2rem; font-weight: 700; color: var(--text-main); margin: 0 0 25px 0; }
.btn-pay { display: inline-block; background: var(--primary); color: #fff; text-decoration: none; padding: 12px 30px; border-radius: 30px; font-weight: 600; font-size: 1rem; transition: all 0.3s ease; }
.btn-pay:hover { background: var(--primary-hover); }

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-content { padding: 15px; }
    .dashboard-header { flex-wrap: wrap; padding: 15px; }
    .burger-toggle { display: block; }
}

/* ==========================================
   Sidebar Navigation
   ========================================== */
.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-nav {
    flex: 1;
    padding: 30px 20px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.nav-icon {
    font-size: 1.25rem;
    margin-right: 12px;
}

.nav-link:hover {
    background: #f4f7f6;
    color: var(--text-main);
}

/* Active State */
.nav-link.active {
    background: #ffebee; /* Soft background using your red theme */
    color: var(--primary);
    font-weight: 600;
}

/* Logout button styling */
.nav-item.logout-item {
    margin-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 20px;
}

.logout-link {
    color: #d32f2f;
}

.logout-link:hover {
    background: #ffebee;
    color: #b71c1c;
}

/* Mobile Sidebar behavior */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100vh;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: 5px 0 25px rgba(0,0,0,0.1);
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
}

/* ==========================================
   Payment History Table
   ========================================== */
.history-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #eaeeec;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: #fff;
}

.history-table th {
    background-color: #f4f7f6;
    color: var(--text-muted);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid #eaeeec;
    white-space: nowrap;
}

.history-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #eaeeec;
    color: var(--text-main);
    font-size: 0.95rem;
    vertical-align: middle;
}

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

.history-table tr:hover {
    background-color: #fafbfc;
}

/* Status Badges */
.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Handles different case variations from your database */
.status-Success, .status-success, .status-Completed { background: #dcfce7; color: #16a34a; }
.status-Failed, .status-failed, .status-Failure { background: #fee2e2; color: #dc2626; }
.status-Pending, .status-pending { background: #fef08a; color: #a16207; }

/* ==========================================
   Pre-Auth Subscription Banner
   ========================================== */
.pre-auth-banner {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
}

.pre-auth-banner h2 {
    color: var(--text-main);
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.pre-auth-banner p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 25px;
}

.mini-plans-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mini-plan-card {
    background: #fff;
    border: 2px solid #f4f7f6;
    border-radius: 16px;
    padding: 15px 25px;
    text-align: center;
    min-width: 150px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
    transition: transform 0.3s ease, border-color 0.3s;
}

.mini-plan-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.mini-plan-title {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.mini-plan-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}