/* Base Styles */
:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --accent-color: #ea4335;
    --text-color: #333;
    --light-text: #666;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background-color: #ffffff;
    color: var(--text-color);
    padding: 12px 0;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-top: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.back-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.back-btn svg {
    transition: transform 0.3s ease;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .back-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

/* Header styles for non-home pages */
.non-home-header {
    background-color: #ffffff;
    color: var(--text-color);
    padding: 12px 0;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.non-home-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.non-home-header .search-container {
    display: none;
}

.non-home-header .back-btn {
    margin: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--logo-color, #1e293b);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    animation: elegantSlideIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
}

.header-logo-img {
    height: 36px;
    width: auto;
}

@keyframes elegantSlideIn {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* Header Search Icon Button */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #1e293b;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #f1f5f9;
}

/* Desktop Top Navigation & Profile Icon */
.desktop-nav {
    display: none;
    align-items: center;
    gap: 5px;
    margin-right: 10px;
}

.desktop-nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.2s;
    padding: 6px 10px;
    border-radius: 8px;
}

.desktop-nav-link:hover {
    background-color: #f1f5f9;
}

.header-profile-pic {
    width: 34px; height: 34px; border-radius: 50%;
    cursor: pointer; object-fit: cover; border: 2px solid transparent;
    transition: 0.2s; display: none;
}
.header-profile-pic:hover { border-color: var(--primary-color); }

/* YouTube style full screen search */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 3000;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.2s ease-out;
}

.search-overlay.active {
    display: flex;
}

.search-overlay-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
    background-color: #fff;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background-color: #f1f5f9;
    border-radius: 20px;
    padding: 0 15px;
}

#overlaySearchInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 1rem;
    outline: none;
    color: var(--text-color);
}
/* Hero Section */
.hero {
    background: #ffffff;
    color: var(--text-color);
    padding: 70px 0;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(66, 133, 244, 0.05) 0%, rgba(255,255,255,0) 70%);
    z-index: 0;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
    animation: fadeUp 1s ease-out forwards;
}

.hero h2 {
    font-size: 2.8rem;
    margin-bottom: 18px;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.15rem;
    color: var(--light-text);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Featured Tools Section */
.featured-tools {
    padding: 20px 0 40px;
}

.featured-tools h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: var(--text-color);
}

/* Footer */
footer {
    background-color: #1e293b;
    color: white;
    padding: 25px 0;
    margin-top: 40px;
    opacity: 0; /* Shuru mein footer hide rahega */
    transform: translateY(20px); /* Thoda niche se upar aayega */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

footer.visible {
    opacity: 1; /* Load hone ke baad show hoga */
    transform: translateY(0);
}

footer p {
    text-align: center;
    margin-bottom: 15px;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0;
    }

    .hero h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* Mobile-specific optimizations */
@media (max-width: 480px) {
    header {
        padding: 10px 0;
    }

    .logo {
        font-size: 1.5rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .header-actions {
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 5px !important;
    }

    .header-profile-pic {
        display: none !important;
    }

    /* Guest Mode Button Mobile Adjustments */
    .guest-indicator-btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
        margin-left: 0 !important;
    }
    .guest-indicator-btn span {
        width: 6px !important;
        height: 6px !important;
    }
}

/* Performance optimizations */
img {
    max-width: 100%;
    height: auto;
}

button, a {
    cursor: pointer;
}

/* Accessibility */
:focus {
    outline: none !important;
}

:focus-visible, input:focus, textarea:focus, select:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1) !important;
}

button:active, a:active {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1) !important;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Reduce render-blocking CSS */
@media print {
    .hero {
        display: none;
    }
}

/* Problem Section Styles */
.problem-section {
    background-color: var(--card-bg);
    padding: 40px 0;
    margin-top: 20px;
    border-top: 2px solid var(--primary-color);
    animation: fadeIn 0.5s ease-out;
}

.problem-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.problem-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.problem-content p {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.problem-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.problem-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.problem-btn:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.problem-btn:active {
    transform: translateY(0);
}

/* Animation for problem section */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    border-top: 1px solid #eee;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--light-text);
    font-size: 10px;
    letter-spacing: 0.2px;
    font-weight: 500;
    padding: 5px;
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--text-color);
    font-weight: 600;
}

.nav-item.active svg {
    stroke-width: 2.2;
    color: var(--text-color);
}

.nav-item svg {
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

body.has-bottom-nav {
    padding-bottom: 70px;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
    .desktop-nav {
        display: flex;
    }
    body.has-bottom-nav {
        padding-bottom: 0;
    }
}

/* Profile Modal New Buttons */
.modal-btn-creator {
    background: var(--primary-color); color: white; width: 100%;
    padding: 12px; border: none; border-radius: 8px; margin-top: 15px;
    cursor: pointer; font-weight: bold; transition: 0.2s;
}
.modal-btn-creator:hover { background: #3367d6; }

.modal-btn-delete {
    background: transparent; color: #ea4335; width: 100%;
    padding: 10px; border: 1px solid #ea4335; border-radius: 8px; margin-top: 10px;
    cursor: pointer; font-weight: bold; transition: 0.2s;
}
.modal-btn-delete:hover { background: #ea4335; color: white; }

/* Responsive Tools Grid & Social Cards */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Card chaurayi kam ki gayi hai */
    gap: 20px;
    width: 100%;
}

.tool-card-wrapper {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

/* Mobile me strictly 1 line me 2 card dikhane ke liye */
@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px; /* 2 cards ke liye spacing thodi kam ki hai */
    }
    .tool-card-link > div {
        padding: 10px !important; /* Mobile me card ki height kam karne ke liye */
    }
    .tool-card-link h4 {
        font-size: 0.9rem !important; /* Text size thoda compact ho jayega */
    }
    .tool-actions {
        padding: 6px 4px;
    }
    .action-btn {
        padding: 3px 2px;
        font-size: 0.75rem;
        gap: 2px;
    }
    .action-btn svg {
        width: 14px;
        height: 14px;
    }
}

.tool-card-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px; /* Lambai kam karne ke liye padding ghatai */
}

/* Disable inside card hover so wrapper handles it cleanly */
.tool-card-link > div {
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    margin: 0 !important;
}

/* --- Card Strict Size Limits --- */
.card-content-limit {
    max-height: 180px; /* Laptop / Tablet Standard Height */
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.show-on-mobile-only {
    display: none;
}

.mobile-more-container {
    position: relative;
}

.mobile-more-dropdown {
    display: none;
    position: absolute;
    bottom: 110%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 50;
    flex-direction: column;
    min-width: 140px;
    overflow: hidden;
}

.mobile-more-dropdown.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.mobile-more-dropdown .action-btn {
    width: 100%;
    padding: 10px 15px;
    border-radius: 0;
    justify-content: flex-start;
}

.mobile-more-dropdown .action-btn:hover {
    background: var(--background-color);
}

.tool-actions {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px; /* Action bar ki lambai kam ki gayi */
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

.action-btn {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    padding: 5px 6px;
    border-radius: 8px;
}

.action-btn:hover { 
    color: var(--text-color);
    background: var(--background-color);
}

.action-btn svg {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn:active svg {
    transform: scale(0.85);
}

.action-btn.active.like-btn { color: var(--primary-color); }
.action-btn.active.like-btn svg { fill: var(--primary-color); stroke: var(--primary-color); animation: popIcon 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

.action-btn.active.dislike-btn { color: #ea4335; }
.action-btn.active.dislike-btn svg { fill: #ea4335; stroke: #ea4335; animation: popIcon 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes popIcon {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Extra Small Mobile adjustments for Cards and Menus */
@media (max-width: 480px) {
    .card-content-limit {
        max-height: 120px; /* Mobile strict height limit */
    }
    .hide-on-mobile {
        display: none !important;
    }
    .show-on-mobile-only {
        display: block !important;
    }
}

/* Central Custom Notification System (Centered Toast) */
.sh-toast-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(255, 255, 255, 0.98);
    color: #1e293b;
    padding: 16px 30px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    pointer-events: none;
    border: 1px solid #e2e8f0;
}
.sh-toast-notification.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.sh-toast-success { border-bottom: 4px solid #10b981; }
.sh-toast-error { border-bottom: 4px solid #ef4444; }
.sh-toast-info { border-bottom: 4px solid #3b82f6; }

/* Custom Confirm Modal */
.custom-notification-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; opacity: 0; visibility: hidden; transition: 0.3s;
}
.custom-notification-overlay.active { opacity: 1; visibility: visible; }
.custom-notification-box { background: #ffffff; border-radius: 16px; padding: 30px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.2); transform: scale(0.9); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.custom-notification-overlay.active .custom-notification-box { transform: scale(1); }

/* AI Sidebar Modern Search & Chat Items */
.sidebar-search-btn {
    display: flex;
    align-items: center;
    background: transparent;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 5px 15px 15px 15px;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
    width: calc(100% - 30px);
    text-align: left;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
}
.sidebar-search-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.sidebar-search-btn .search-icon {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.history-label {
    padding: 5px 15px 10px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-history {
    padding: 0 10px 20px;
    overflow-y: auto;
}
.chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: #475569;
}
.chat-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.chat-item.active {
    background: #eff6ff;
    color: var(--primary-color);
    font-weight: 700;
}
.chat-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}
.chat-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}
.chat-options-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    opacity: 0;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.chat-item:hover .chat-options-btn,
.chat-item.active .chat-options-btn {
    opacity: 1;
}
.chat-options-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* AI Chat Item Dropdown */
.chat-item .dropdown-menu {
    position: absolute;
    top: 40px;
    right: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    flex-direction: column;
    min-width: 140px;
    overflow: hidden;
}
.chat-item .dropdown-menu.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}
.chat-item .dropdown-menu button {
    background: none;
    border: none;
    padding: 10px 15px;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: background 0.2s;
}
.chat-item .dropdown-menu button:hover {
    background: #f8fafc;
    color: var(--primary-color);
}
.chat-item .dropdown-menu button.delete-btn {
    color: #ef4444;
}
.chat-item .dropdown-menu button.delete-btn:hover {
    background: #fef2f2;
}

/* AI Page Professionalism Tweaks */
.sidebar .brand-name {
    font-weight: 500;
    font-size: 1.1rem;
}

.new-chat-btn .btn-text {
    font-weight: 500;
}

.main-area .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-spacer {
    flex: 1;
}

.ai-modal-overlay .modal-close-btn {
    background: transparent;
    color: #94a3b8;
    padding: 4px;
}

.chat-search-modal-body .modal-empty-message {
    text-align: center;
    color: #64748b;
    padding: 30px 20px;
}

.message.loading-msg .content {
    color: var(--ai-text-light);
}

/* AI Page - Empty State Professional & Humble Redesign */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

.empty-state-logo {
    background: #eef2ff; /* Lighter blue background */
    border-radius: 50%;
    padding: 15px;
    margin-bottom: 20px;
    border: 6px solid #ffffff;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.1);
}

.empty-state-logo img {
    width: 48px;
    height: 48px;
    display: block;
}

.empty-state-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.empty-state-subtitle {
    font-size: 1.1rem;
    color: #475569;
    max-width: 550px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.example-prompts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; width: 100%; max-width: 800px; }
.prompt-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 15px; text-align: left; cursor: pointer; transition: all 0.2s ease; }
.prompt-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.07); border-color: var(--primary-color); }
.prompt-card h4 { font-size: 0.95rem; font-weight: 600; color: #334155; margin: 0 0 4px 0; }
.prompt-card p { font-size: 0.9rem; color: #64748b; margin: 0; line-height: 1.5; }

@media (max-width: 768px) {
    .example-prompts {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    .empty-state-title { font-size: 1.5rem; }
    .empty-state-subtitle { font-size: 1rem; }
}
