/* =============================================================================
   TOOLS PAGE STYLES - FINAL VERSION
   ============================================================================= */

/* --- PAGE LAYOUT --- */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
    position: relative;
    z-index: 1;
}

/* --- TOOLS HEADER --- */
.tools-header {
    text-align: center;
    padding: 10px 20px;
    margin-bottom: 10px;
}

.tools-header h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: center;
}

/* --- GLITCH EFFECT (EXACT MATCH FROM INDEX.CSS) --- */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--main-red);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #2AABEE, 2px 2px var(--main-red);
    animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(42px, 9999px, 44px, 0); }
    100% { clip: rect(80px, 9999px, 120px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(85px, 9999px, 90px, 0); }
    100% { clip: rect(145px, 9999px, 85px, 0); }
}

.tools-subtitle {
    font-size: 1.4rem;
    color: #ff9999;
    text-shadow: 0 0 8px var(--main-red);
    margin-bottom: 0;
    font-weight: 600;
    text-align: center;
}

/* --- TOOLS GRID --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding: 10px 0;
}

/* --- TOOL CARD --- */
.tool-card {
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-card:hover {
    border-color: var(--main-red);
    box-shadow: 0 0 20px rgba(255, 85, 85, 0.3);
    transform: translateY(-3px);
}

.tool-card h2 {
    font-size: 1.8rem;
    color: var(--main-red);
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 85, 85, 0.4);
}

.tool-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* --- TWEET GENERATOR --- */
.tweet-display {
    background: rgba(13, 13, 13, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-height: 150px;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-main);
}

/* --- CALCULATOR INPUTS --- */
.calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.input-group input {
    background: rgba(13, 13, 13, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 12px 15px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--main-red);
    box-shadow: 0 0 10px rgba(255, 85, 85, 0.2);
}

.input-group input::placeholder {
    color: #666;
}

/* --- MARKET CAP PRESETS --- */
.mcap-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.preset-btn {
    background: rgba(13, 13, 13, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.preset-btn:hover {
    background: rgba(255, 85, 85, 0.1);
    border-color: var(--main-red);
    color: var(--main-red);
    transform: translateY(-2px);
}

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

/* --- CALCULATOR RESULT --- */
.calc-result {
    background: rgba(13, 13, 13, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-height: 80px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.calc-result.success {
    color: var(--main-red);
    font-size: 1.4rem;
    border-color: var(--main-red);
}

.calc-result.error {
    color: #ff6b6b;
}

/* --- TOOL ACTIONS --- */
.tool-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    flex-wrap: wrap;
}

.tool-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 5px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.tool-btn.primary {
    background: var(--main-red);
    color: var(--text-primary);
    border-color: var(--hover-red);
}

.tool-btn.primary:hover {
    background: var(--hover-red);
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.5);
    transform: translateY(-2px);
}

.tool-btn.secondary {
    background: transparent;
    color: var(--main-red);
    border-color: var(--main-red);
}

.tool-btn.secondary:hover {
    background: rgba(255, 85, 85, 0.1);
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.3);
    transform: translateY(-2px);
}

/* =============================================================================
   MOBILE NAVIGATION - FIXED
   ============================================================================= */

/* DESKTOP: Force hide ALL mobile elements */
.hamburger,
.buy-btn-mobile,
.mobile-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* MOBILE: Force show mobile elements */
@media (max-width: 768px) {
    /* Show mobile hamburger */
    .hamburger {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
        top: 15px !important;
        left: 15px !important;
        z-index: 1100 !important;
        flex-direction: column !important;
        justify-content: space-around !important;
        width: 30px !important;
        height: 22px !important;
        cursor: pointer !important;
        padding: 5px !important;
        background-color: rgba(13, 13, 13, 0.8) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 5px !important;
    }
    
    /* White hamburger lines */
    .hamburger div {
        width: 20px !important;
        height: 2px !important;
        background-color: #eee !important;
        margin: 0 auto !important;
        transition: all 0.3s ease !important;
    }
    
    /* Hamburger X animation */
    .hamburger.active div:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
    }
    
    .hamburger.active div:nth-child(2) {
        opacity: 0 !important;
    }
    
    .hamburger.active div:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px) !important;
    }
    
    /* Mobile menu dropdown */
    .mobile-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 15px;
        width: 180px;
        background-color: rgba(13, 13, 13, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        z-index: 1099;
        padding: 10px 0;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Show menu when toggled */
    .mobile-menu[style*="display: block"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* Menu links */
    .mobile-menu a {
        display: block !important;
        color: var(--text-primary) !important;
        padding: 12px 20px !important;
        text-decoration: none !important;
        font-weight: 700 !important;
        transition: all 0.3s !important;
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    
    .mobile-menu a:hover {
        color: var(--main-red) !important;
        background-color: rgba(255, 255, 255, 0.05) !important;
    }
    
    /* Mobile buy button */
    .buy-btn-mobile {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 1100 !important;
        background-color: var(--main-red) !important;
        color: white !important;
        padding: 8px 15px !important;
        border-radius: 5px !important;
        text-decoration: none !important;
        font-family: 'Inter', sans-serif !important;
        font-weight: 700 !important;
        font-size: 0.9rem !important;
    }

    /* Hide desktop navigation */
    .nav-links {
        display: none !important;
    }

    .nav-actions .cta-button {
        display: none !important;
    }
    
    /* Center logo */
    .navbar {
        justify-content: center !important;
    }

    /* Mobile responsive styles */
    .content-wrapper {
        padding: 70px 15px 40px;
    }

    .tools-header {
        padding: 20px 15px;
    }

    .tools-header h1 {
        font-size: 2.5rem;
    }

    .tools-subtitle {
        font-size: 1.1rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tool-card {
        padding: 20px;
    }

    .tool-card h2 {
        font-size: 1.5rem;
    }

    .tool-actions {
        flex-direction: column;
    }

    .tool-btn {
        width: 100%;
    }

    .tweet-display {
        min-height: 120px;
        font-size: 0.9rem;
    }

    .calc-result {
        min-height: 60px;
        font-size: 1rem;
    }

    .calc-result.success {
        font-size: 1.2rem;
    }

    .mcap-presets {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .preset-btn {
        font-size: 0.75rem;
        padding: 8px 4px;
    }
}

/* --- REDUCED MOTION SUPPORT --- */
@media (prefers-reduced-motion: reduce) {
    .tool-card,
    .tool-btn,
    .preset-btn {
        transition: none !important;
    }
}
