/*
  Theme Name: HayPiggy
  Author: Gemini
  Description: A Playful & Modern theme for a GPT site.
  Version: 2.0
*/

/* 
==============================================
--- 1. VARIABLES & GENERAL STYLES ---
==============================================
*/
:root {
  --primary-color: #3b82f6; /* A friendly, vibrant blue */
  --secondary-color: #f3f4f6; /* A very light gray for backgrounds */
  --accent-color: #ec4899; /* A playful, energetic pink */
  --text-color: #1f2937; /* Dark gray for readability */
  --text-muted: #6b7280;
  --white-color: #ffffff;
  --border-radius: 12px;
  --font-family: 'Poppins', sans-serif;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--secondary-color);
  color: var(--text-color);
  margin: 0;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

/* 
==============================================
--- 2. CORE COMPONENTS (Buttons, Cards, Forms) ---
==============================================
*/
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white-color);
}

.btn-primary:hover {
  background-color: #2563eb;
  color: var(--white-color);
}

.btn-accent {
  background-color: var(--accent-color);
  color: var(--white-color);
}

.btn-accent:hover {
  background-color: #db2777;
  color: var(--white-color);
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}
.btn-danger:hover {
    background-color: #b91c1c;
    color: white;
}

.hay-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
}

.hay-card h2 { font-size: 1.5rem; margin: 0 0 1rem 0; padding-bottom: 0.5rem; border-bottom: 1px solid #e5e7eb; }
.hay-card h3 { font-size: 1.5rem; margin: 0 0 0.5rem 0; }
.hay-card p { margin: 0 0 1.5rem 0; color: #6b7280; }

.input-wrap { margin-bottom: 1rem; }
.input-wrap label { font-weight: 600; display: block; margin-bottom: 0.5rem; }
.input-std { 
    width: 100%; 
    padding: 12px 15px; 
    border-radius: 8px; 
    border: 1px solid #d1d5db; 
    font-size: 1rem;
    box-sizing: border-box;
}

hr.form-divider {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* 
==============================================
--- 3. LAYOUT (Sidebar, Header, Footer) ---
==============================================
*/
.dashboard-body { display: flex; background-color: #f3f4f6; min-height: 100vh; }
.sidebar { width: 260px; background: #ffffff; padding: 1.5rem; display: flex; flex-direction: column; border-right: 1px solid #e5e7eb; flex-shrink: 0; }
.sidebar .logo { font-size: 2rem; font-weight: 700; color: var(--primary-color); text-align: center; margin-bottom: 2rem; text-decoration: none; }
.sidebar .logo span { color: var(--accent-color); }
.nav-category { font-size: 0.75rem; font-weight: 600; color: #9ca3af; text-transform: uppercase; margin-top: 1.5rem; margin-bottom: 0.5rem; padding: 0 0.75rem; }
.nav-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem; border-radius: var(--border-radius); color: #374151; font-weight: 500; text-decoration: none; transition: all 0.2s ease; }
.nav-item:hover { background-color: #f3f4f6; color: var(--text-color); }
.nav-item.active { background-color: var(--primary-color); color: white; font-weight: 600; }
.nav-item i { width: 20px; text-align: center; }
.main-wrapper { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden; 
    overflow-y: auto; 
    min-width: 0; 
    width: 100%;
}
.topbar { background: #ffffff; padding: 1rem 2rem; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: flex-end; align-items: center; }
.topbar-balance { background: #eef2ff; border: 1px solid #c7d2fe; padding: 0.5rem 1rem; border-radius: var(--border-radius); display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.topbar-balance i { color: #6366f1; }
.topbar-balance span { color: #4338ca; }
.topbar-user { margin-left: 1.5rem; display:flex; align-items:center; }
.topbar-user img { width: 40px; height: 40px; border-radius: 50%; }
.topbar-user a { margin-left: 1rem; color: #6b7280; font-size: 1.2rem; }
.content-wrapper { padding: 2rem; flex: 1; }
.footer { background: #ffffff; padding: 1.5rem 2rem; border-top: 1px solid #e5e7eb; margin-top: auto; }
.footer-content { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: #6b7280; }
.footer-content nav a { color: #6b7280; margin-left: 1.5rem; }
.footer-content nav a:hover { color: var(--primary-color); }

/* 
==============================================
--- 4. PAGE-SPECIFIC COMPONENTS ---
==============================================
*/

/* --- Alerts --- */
.hay-alert { padding: 1rem; border-radius: var(--border-radius); margin-bottom: 1.5rem; border: 1px solid transparent; }
.hay-alert-success { background-color: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.hay-alert-danger { background-color: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.hay-alert-info { background-color: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* --- Dashboard & Affiliates --- */
.dash-header { background: linear-gradient(135deg, var(--primary-color), #60a5fa); color: white; padding: 2rem; border-radius: var(--border-radius); margin-bottom: 2rem; }
.dash-header h1 { font-size: 2.2rem; margin: 0; color: white !important;}
.dash-header p { color: white; opacity: 0.9; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: white; padding: 1.5rem; border-radius: var(--border-radius); display: flex; align-items: center; gap: 1rem; border: 1px solid #e5e7eb; }
.stat-card .icon { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-card .icon.primary { background: #dbeafe; color: #3b82f6; }
.stat-card .icon.accent { background: #fce7f3; color: #ec4899; }
.stat-card .icon.green { background: #d1fae5; color: #059669; }
.stat-card .value { font-size: 1.5rem; font-weight: 600; }
.stat-card .label { font-size: 0.9rem; color: #6b7280; }
.section-title { font-size: 1.8rem; font-weight: 600; margin-bottom: 1.5rem; }
.invite-card { background: var(--primary-color); color: white; padding: 2.5rem; border-radius: var(--border-radius); margin-bottom: 2rem; }
.invite-card h2 { color: white; }
.invite-card p { color: #dbeafe; max-width: 600px; }
.link-copy-wrapper { display: flex; background: rgba(0,0,0,0.1); border-radius: 10px; padding: 5px; max-width: 500px; }
.link-copy-wrapper input { flex-grow: 1; background: transparent; border: none; color: white; padding: 0 1rem; font-family: monospace; }
.link-copy-wrapper input:focus { outline: none; }
.link-copy-wrapper button { background: white; color: var(--primary-color); padding: 0.5rem 1rem; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; }
.code-group { margin-bottom: 1rem; }
.code-group label { display: block; font-weight: 600; color: #374151; margin-bottom: 0.5rem; }
.code-group textarea { width: 100%; padding: 1rem; border-radius: 8px; border: 1px solid #d1d5db; font-family: monospace; background-color: #f9fafb; resize: none; }

/* --- Tables & Pagination (History, Referrals, Top10) --- */
.hay-card.card-table { padding: 0; }
.table-responsive { overflow-x: auto; }
.hay-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.hay-table th, .hay-table td { padding: 1rem 1.5rem; text-align: left; border-bottom: 1px solid #e5e7eb; vertical-align: middle; }
.hay-table th { font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; background-color: #f9fafb; }
.hay-table td { color: #374151; font-size: 0.9rem; }
.hay-table .text-center { text-align: center; }
.hay-table .text-right { text-align: right; }
.hay-badge { display: inline-block; padding: 0.25rem 0.6rem; font-size: 0.75rem; font-weight: 500; border-radius: 6px; background-color: #eef2ff; color: #4338ca; }
.status-pill { padding: 4px 12px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; }
.status-pill-success { background: #dcfce7; color: #166534; }
.status-pill-pending { background: #fefce8; color: #a16207; }
.status-pill-danger { background: #fee2e2; color: #991b1b; }
.hay-pagination { padding: 1.5rem; display: flex; justify-content: center; gap: 0.5rem; background-color: #f9fafb; border-top: 1px solid #e5e7eb;}
.page-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #d1d5db; border-radius: 8px; color: #374151; font-weight: 600; font-size: 0.9rem; background-color: #fff; transition: all 0.2s ease; }
.page-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.page-btn.active { background-color: var(--primary-color); border-color: var(--primary-color); color: white; }
.rank-cell { font-weight: 700; font-size: 1.1rem; text-align: center; }
.rank-1 .rank-cell { color: #d97706; }
.rank-2 .rank-cell { color: #6b7280; }
.rank-3 .rank-cell { color: #a16207; }
.user-cell { display: flex; align-items: center; gap: 1rem; }
.user-cell img { width: 40px; height: 40px; border-radius: 50%; }
.user-cell .crown { color: #f59e0b; margin-left: 0.5rem; }

/* --- Withdraw Page --- */
.methods-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.method-card { background: white; border-radius: var(--border-radius); border: 2px solid #e5e7eb; padding: 1.5rem; text-align: center; cursor: pointer; transition: all 0.2s ease; }
.method-card.disabled { opacity: 0.5; cursor: not-allowed; background: #f9fafb; }
.method-card:not(.disabled):hover { border-color: var(--accent-color); transform: translateY(-5px); }
.method-card.active { border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-color); }
.method-card img { height: 40px; max-width: 100px; object-fit: contain; margin-bottom: 1rem; }
.method-card h4 { margin: 0 0 0.25rem 0; font-size: 1rem; }
.method-card span { font-size: 0.8rem; color: #6b7280; }
.withdraw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 992px) { .withdraw-grid { grid-template-columns: 1fr; } }

/* --- Account Page --- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.hay-card-danger { border-color: #fca5a5; background-color: #fff5f5; }
.hay-card-danger h3 { color: #b91c1c; }

/* --- Tasks Page --- */
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.task-card { background: #fff; border-radius: var(--border-radius); border: 1px solid #e5e7eb; display: flex; flex-direction: column; }
.task-header { padding: 1rem 1.5rem; border-bottom: 1px solid #e5e7eb; }
.task-header h3 { margin: 0; font-size: 1.2rem; }
.task-reward { font-weight: 700; color: #166534; }
.task-body { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.task-desc { color: #374151; flex-grow: 1; margin-bottom: 1.5rem; }
.task-form { display: flex; gap: 0.5rem; }
.task-form input { flex-grow: 1; }
.status-box { padding: 1rem; border-radius: 8px; text-align: center; font-weight: 600; }

/* --- Contact Page --- */
.contact-grid { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: flex-start; }
.info-sidebar .hay-card { padding: 1.5rem; text-align: center; }
.info-sidebar .icon { font-size: 1.5rem; color: var(--primary-color); margin-bottom: 1rem; }
@media (max-width: 992px) { .contact-grid { grid-template-columns: 1fr; } .info-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; gap: 0; } .info-sidebar { grid-template-columns: 1fr; } }

/* --- FAQ Page --- */
.faq-container { max-width: 800px; margin: 2rem auto; }
.hay-accordion .faq-item { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--border-radius); margin-bottom: 1rem; overflow: hidden; }
.faq-trigger { width: 100%; background: transparent; border: none; padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 1.1rem; font-weight: 600; color: #1f2937; }
.faq-icon { color: var(--primary-color); transition: transform 0.3s ease; }
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.faq-answer { padding: 0 1.5rem 1.5rem; color: #374151; line-height: 1.6; }

/* --- Legal Pages --- */
.legal-container { max-width: 800px; margin: 2rem auto; }
.legal-container ol { padding-left: 1.5rem; line-height: 1.8; color: #374151; }

/* --- Redeem Page --- */
.redeem-container { max-width: 550px; margin: 2rem auto; text-align: center; }
.redeem-icon { font-size: 3rem; color: var(--primary-color); margin-bottom: 1rem; }
.redeem-container h2 { font-size: 1.8rem; margin: 0 0 0.5rem 0; }
.redeem-container p { color: #6b7280; margin: 0 0 2rem 0; }
.redeem-input { font-size: 1.5rem !important; font-weight: 700 !important; text-align: center !important; letter-spacing: 3px !important; text-transform: uppercase !important; }

/*
==============================================
--- 5. LANDING PAGE STYLES (FROM home.php) ---
==============================================
*/
.hay-body { font-family: var(--font-family); background-color: #f9fafb; color: var(--text-color); }
.hay-container { max-width: 1100px; margin: 0 auto; padding: 4rem 1rem; text-align: center; }
.hay-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 2rem; background-color: var(--white-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; }
.hay-logo { font-size: 1.8rem; font-weight: 700; color: var(--primary-color); }
.hay-logo span { color: var(--accent-color); }
.hay-nav a, .hay-btn { font-size: 1rem; font-weight: 600; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: var(--border-radius); transition: all 0.3s ease; }
.hay-nav a { color: var(--text-color); margin-left: 0.5rem; }
.hay-nav a:hover { background-color: #f3f4f6; }
.hay-hero h1 { font-size: 3.5rem; font-weight: 700; line-height: 1.2; margin-bottom: 1rem; color: var(--text-color); }
.hay-hero p { font-size: 1.25rem; color: #4b5563; margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hay-how-it-works { background-color: var(--white-color); border-radius: var(--border-radius); padding: 4rem 2rem; }
.hay-section-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 3rem; }
.hay-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; text-align: left; }
.hay-step { background: #f9fafb; padding: 2rem; border-radius: var(--border-radius); border: 1px solid #e5e7eb; }
.hay-step .step-number { display: inline-block; width: 40px; height: 40px; line-height: 40px; text-align: center; border-radius: 50%; background-color: var(--accent-color); color: var(--white-color); font-weight: 700; font-size: 1.2rem; margin-bottom: 1rem; }
.hay-step h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.hay-why-join .hay-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; text-align: left; }
.hay-feature { padding: 1.5rem; }
.hay-feature i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.hay-cta { background-color: var(--primary-color); color: var(--white-color); border-radius: var(--border-radius); }
.hay-cta p { font-size: 1.2rem; color: #dbeafe; }
.hay-cta .hay-btn-accent { background-color: var(--accent-color); color: var(--white-color); }
/* 
==============================================
--- 6. MODALS & OVERLAYS ---
==============================================
*/
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none !important; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex !important;
}

.modal-box {
    background: white;
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    z-index: 1010;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    background: rgba(0,0,0,0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.4);
    transform: rotate(90deg);
}

.wall-iframe-container {
    width: 100%;
    height: 100%;
}

/* 
==============================================
--- 7. CAROUSEL / SCROLLER ---
==============================================
*/
.carousel-container {
    position: relative;
    margin-bottom: 2.5rem;
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.5rem 0.25rem 1.5rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

.carousel-track .offer-card {
    flex: 0 0 280px; /* Fixed width for carousel items */
    margin-bottom: 0;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 5;
    border: 1px solid #e5e7eb;
    color: var(--primary-color);
    transition: all 0.2s;
}

.carousel-arrow:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.carousel-arrow.left { left: -22px; }
.carousel-arrow.right { right: -22px; }

@media (max-width: 768px) {
    .carousel-arrow { display: none; }
    .carousel-track { padding-left: 1rem; padding-right: 1rem; }
}

