/* --- GLOBAL & VARIABLES --- */
:root {
    --bg-color: #ffffff;
    --text-color: #111111;
    --secondary-text: #666666;
    --card-bg: #f9f9f9;
    --border-color: #e2e2e2;
    --primary-accent: #000000;
    --primary-accent-text: #ffffff;
    --btn-hover: #333333;
    --transition: all 0.3s ease;
}

.dark-mode {
    --bg-color: #121212;
    --text-color: #f1f1f1;
    --secondary-text: #aaaaaa;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --primary-accent: #ffffff;
    --primary-accent-text: #000000;
    --btn-hover: #cccccc;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER (100% Width with 1200px inner container) --- */
header {
    width: 100%;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    padding-bottom: 15px;
}
 
.logo a { 
    font-size: 24px; 
    font-weight: 800; 
    text-decoration: none; 
    color: var(--text-color); 
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--secondary-text);
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

/* --- DROPDOWN MENU (Desktop) --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    /* Added padding to create an invisible bridge for mouse hover */
    padding-bottom: 20px; 
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--card-bg);
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 1001;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    /* Set top to 100% to stick right below the link */
    top: 100%; 
    left: -180px;
    /* Added small top margin if needed, but the padding on dropbtn covers the gap */
    margin-top: 0; 
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--border-color);
    border-radius: 8px;
}

/* Keeps the menu open as long as the mouse is on the button or the menu itself */
.dropdown:hover .dropdown-content {
    display: block;
}

/* --- MOBILE DROPDOWN MENU --- */
.mobile-dropdown {
    display: flex;
    flex-direction: column;
}

.mobile-dropbtn {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    width: 100%; /* Ensure full width for tapping */
    padding: 5px 0;
}

.mobile-dropdown-content {
    display: none; /* Hidden by default */
    flex-direction: column;
    padding-left: 20px;
    margin-top: 10px;
    border-left: 2px solid var(--border-color);
}

/* This class will be toggled by Javascript */
.mobile-dropdown-content.show {
    display: flex;
}

.mobile-dropdown-content a {
    font-size: 16px;
    padding: 10px 0;
    color: var(--secondary-text);
}

.mobile-dropdown-content a:hover {
    color: var(--text-color);
}

/* --- MOBILE OFFCANVAS MENU --- */
.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
    user-select: none;
}

.offcanvas {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 2000;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.offcanvas.open {
    right: 0;
}

.offcanvas-close {
    font-size: 36px;
    cursor: pointer;
    align-self: flex-end;
    line-height: 1;
    user-select: none;
}

.offcanvas a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 18px;
}

.offcanvas .theme-toggle {
    margin-top: 10px;
}

@media (max-width: 600px) {
    .nav-links { display: none; }
    .hamburger { display: block; }
}

/* --- HERO SECTION --- */
.hero {
    text-align: center;
    padding: 60px 0 10px;
}

.hero-badge {
    display: inline-block;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 40px;
    font-weight: 800;
}

.search-container {
    position: relative;
    width: 80%;
    margin: 0 auto 30px;
}

.search-container input {
    width: 100%;
    padding: 20px 50px 20px 30px;
    font-size: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: var(--transition);
}

.search-container input:focus {
    border-color: var(--primary-accent);
}

.clear-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-text);
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.style-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary-accent);
    color: var(--primary-accent-text);
    border-color: var(--primary-accent);
}

/* --- Font Size Slider UI --- */
.size-slider-container {
    width: 100%;
    max-width: 1000px; /* Centering limit for wide screens */
    margin: 30px auto 40px auto;
    padding: 0 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: transparent; /* Keeping it clean like your screenshot */
}

.size-slider-container label {
    font-weight: 600;
    font-size: 16px;
    white-space: nowrap; /* Prevents text from breaking */
    color: var(--text-color);
}

#fontSizeSlider {
    flex: 1; /* Automatically takes up all remaining space */
    cursor: pointer;
    accent-color: gray;
    height: 6px;
}

/* Mobile responsive for slider */
@media (max-width: 600px) {
    .size-slider-container {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin: 20px auto;
    }
    
    .size-slider-container label {
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap; /* Prevents text from breaking */
    color: var(--text-color);
    }
    
    #fontSizeSlider {
        width: 100%;
    }
}

/* --- The Magic: Connecting Slider to Text --- */
/* Ye class card me generate hone wale text ki hai */
.styled-text-display {
    /* Agar slider move nahi hua to default 24px rahega */
    font-size: var(--text-size, 18px) !important; 
    transition: font-size 0.1s ease-in-out;
}

/* --- GENERATOR GRID --- */
.generator {
    padding: 10px 0 40px 0;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .grid-layout { grid-template-columns: repeat(2, 1fr); }
    .search-container { width: 90%; }
}

@media (max-width: 600px) {
    .grid-layout { grid-template-columns: 1fr; }
    .search-container { width: 100%; }
    .hero h1 { font-size: 32px; }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 20px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.styled-text-display {
    word-break: break-all;
    min-height: 40px;
    margin-bottom: 15px;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.btn-main {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-main:hover { background: var(--border-color); }

.preview-buttons {
    display: flex;
    gap: 10px;
}

.btn-preview {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.btn-preview:hover { background: var(--border-color); }

/* Inline Preview Container */
.preview-container {
    width: 100%;
    margin: 10px 0 15px 0;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.load-more-container {
    text-align: center;
}

.btn-load {
    background: transparent;
    border: 2px solid var(--primary-accent);
    color: var(--text-color);
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-load:hover {
    background: var(--primary-accent);
    color: var(--primary-accent-text);
}

/* --- INFO SECTIONS --- */
.info-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
}

.card-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
}

.grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 900px) { .grid-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-6 { grid-template-columns: 1fr; } }

/* --- FAQ --- */
.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}
.faq-q {
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}
.faq-a {
    margin-top: 10px;
    color: var(--secondary-text);
    display: none;
}

/* --- FOOTER (100% Width with 1200px inner container) --- */
footer {
    width: 100%;
    background: var(--bg-color);
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--secondary-text);
    margin-top: 40px;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 10px;
}

#backToTop {
    display: none; /* Shuruat mein chhupa rahega */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    font-size: 20px;
    border: none;
    outline: none;
    background-color: gray; /* Aapka primary blue color */
    color: white;
    cursor: pointer;
    padding: 0 8px;
    border-radius: 8px;
    transition: transform 0.3s, background-color 0.3s;
}

#backToTop:hover {
    background-color: #c9cbd6;
    transform: translateY(-5px);
}

/* Dark mode compatibility agar zaroorat ho */
body.dark-mode #backToTop {
    background-color: #555;
}

/* Instagram Original Scoped CSS */
.insta-preview {
    width: 100%; max-width: 390px; height: 480px; 
    background-color: #ffffff; border-radius: 30px;
    overflow: hidden; display: flex; flex-direction: column;
    border: 3px solid #222222; box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    color: #262626; /* Force light mode inside mockup */
}
.insta-preview .top-bar { display: flex; align-items: center; justify-content: center; padding: 12px; border-bottom: 1px solid #efefef; font-weight: 600; font-size: 16px; gap: 5px; }
.insta-preview .verified-badge { width: 18px; height: 18px; fill: #0095f6; }
.insta-preview .profile-content { padding: 16px; }
.insta-preview .header { display: flex; align-items: center; margin-bottom: 18px; }
.insta-preview .profile-pic-container { flex-basis: 30%; }
.insta-preview .profile-pic { width: 80px; height: 80px; background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); border-radius: 50%; padding: 3px; }
.insta-preview .profile-pic-inner { width: 100%; height: 100%; background-color: #efefef; border: 2px solid white; border-radius: 50%; }
.insta-preview .stats { display: flex; flex-grow: 1; justify-content: space-around; text-align: center; }
.insta-preview .stat-item strong { display: block; font-size: 17px; font-weight: 600; }
.insta-preview .stat-item span { font-size: 14px; color: #262626; }
.insta-preview .bio { margin-bottom: 15px; }
.insta-preview #fancyDisplayName { font-size: 15px; font-weight: 700; display: block; margin-bottom: 2px; min-height: 18px; }
.insta-preview .bio p { font-size: 14px; line-height: 1.4; white-space: pre-line; margin-bottom: 2px;}
.insta-preview .bio a { color: #00376b; text-decoration: none; font-size: 14px; font-weight: 500; }
.insta-preview .actions { display: flex; gap: 8px; margin: 15px 0; }
.insta-preview .btn { flex: 1; border: none; border-radius: 8px; padding: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.insta-preview .btn-blue { background: #0095f6; color: white; }
.insta-preview .btn-gray { background: #efefef; color: black; }
.insta-preview .highlights { display: flex; gap: 15px; margin-bottom: 10px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.insta-preview .hl-item { text-align: center; font-size: 12px; min-width: 64px; }
.insta-preview .hl-circle { width: 60px; height: 60px; background: white; border-radius: 50%; border: 1px solid #dbdbdb; margin-bottom: 5px; display: flex; align-items: center; justify-content: center; }
.insta-preview .hl-inner { width: 52px; height: 52px; background: #fafafa; border-radius: 50%; }
.insta-preview .tabs { display: flex; border-top: 1px solid #dbdbdb; }
.insta-preview .tab { flex: 1; text-align: center; padding: 12px; color: #8e8e8e; font-size: 20px; }
.insta-preview .tab.active { color: black; border-top: 1px solid black; margin-top: -1px; }
.insta-preview .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: white; }
.insta-preview .grid-item { background: #efefef; aspect-ratio: 1/1; }

/* WhatsApp Original Scoped CSS */
.phone-mockup {
    width: 100%; max-width: 390px; height: 480px; 
    background-color: #ffffff; border-radius: 30px;
    overflow: hidden; display: flex; flex-direction: column;
    border: 3px solid #222222; box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    color: #111b21;
}
.wa-header-section { background-color: #008069; color: #ffffff; padding: 5px 20px 5px 20px; display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.wa-header-section h2 { font-size: 20px; font-weight: 500; }
.wa-dp-container { padding: 20px 0; display: flex; justify-content: center; position: relative; background: #f0f2f5;}
.wa-avatar-circle { width: 120px; height: 120px; background-color: #e9edef; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.wa-avatar-circle svg { width: 60px; height: 60px; fill: #bfc9ce; }
.wa-cam-badge { position: absolute; bottom: 45px; right: 125px; background-color: #00a884; width: 48px; height: 48px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 3.5px solid #ffffff; }
.wa-info-body { flex: 1; background: #f0f2f5;}
.wa-info-row { display: flex; padding: 18px 25px; gap: 20px; background: #ffffff; margin-bottom: 10px;}
.wa-icon-box { width: 24px; color: #8696a0; padding-top: 5px; }
.wa-text-box { flex: 1; border-bottom: 1px solid #f2f2f2; padding-bottom: 15px; }
.wa-item-label { color: #8696a0; font-size: 14px; margin-bottom: 5px; }
.wa-item-value { color: #111b21; font-size: 17px; font-weight: 500; }
.wa-item-caption { color: #667781; font-size: 13px; margin-top: 8px; line-height: 1.4; }
.wa-edit-pen { color: #00a884; font-size: 18px; }
.wa-bottom-footer { height: 25px; display: flex; justify-content: center; align-items: center; background: #f0f2f5; }
.wa-home-line { width: 100px; height: 5px; background-color: #dddddd; border-radius: 10px; }