:root {
    --bg-main: #0a0a0f;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --secondary: #a855f7;
    --accent: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Animated Background Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary), var(--secondary));
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary), var(--accent));
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

.container {
    max-w-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-top: 6rem;
    margin-bottom: 5rem;
    max-width: 800px;
    animation: fadeUp 1s ease-out forwards;
}

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

.logo-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.mehub-logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.4));
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 4rem;
}

/* Glassmorphism Cards */
.tool-card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.tool-card:not(.coming-soon):hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Hover Glow Effect */
.card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.tool-card:hover .card-glow {
    opacity: 1;
}

/* Card Content */
.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.tool-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(-5deg);
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.icon-gray { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

.tool-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.tags {
    display: flex;
    gap: 0.5rem;
}

.tags span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #cbd5e1;
    font-weight: 500;
}

.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
    border-style: dashed;
}

.ad-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #f8fafc;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-brand:hover {
    opacity: 0.8;
}

.footer-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Referral Banner */
.referral-banner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.referral-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.referral-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.referral-text {
    flex-grow: 1;
}

.referral-text h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #f8fafc;
}

.referral-text p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.referral-btn {
    background: #f8fafc;
    color: #0f172a;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.referral-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
    background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }
    .hero p {
        font-size: 1.1rem;
    }
    .tool-grid {
        grid-template-columns: 1fr;
    }
    .referral-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}

/* Cursor pointer for interactive cards */
.tool-card[data-url] {
    cursor: pointer;
}

/* Iframe Modal */
.iframe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.iframe-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-header {
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid var(--card-border);
}

.modal-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: -0.01em;
}

.modal-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.close-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    transform: scale(1.05);
}

.iframe-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: calc(100vh - 60px);
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff; /* Most tools have dark mode toggle, but default background prevents weird transparency */
    position: relative;
    z-index: 2;
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    z-index: 1;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}
