/* =========================================================
   1. BASE RESETS & VARIABLES 
   ========================================================= */
:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #cbd5e1;
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --light-blue-bg: #eff6ff;
    --card-bg: #ffffff;
    --success-green: #10b981;
    --error-red: #ef4444;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --container: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* =========================================================
   2. MAIN TOOL UI (CONVERTER)
   ========================================================= */
.hero { text-align: center; padding: 40px 20px; }
.hero-title { font-size: 2.25rem; font-weight: 700; margin-bottom: 12px; }
.hero-sub { color: var(--text-secondary); font-size: 1.1rem; }

.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 32px;
    margin: 0 auto 48px;
    max-width: 800px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 20px;
    text-align: center;
    background-color: #fafbfc;
    cursor: pointer;
}

.upload-icon svg { width: 64px; height: 64px; fill: var(--primary-blue); margin-bottom: 16px; }


/* =========================================================
   FIXED RELATED TOOLS GRID (SCOPED)
   ========================================================= */

/* 1. Container - No changes needed to global container */
.related-tools {
    padding: 40px 0;
    width: 100%;
}

.related-tools-container {
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
}

/* 2. Grid - Uses a specific class to avoid hitting the main tool */
.related-tools .tools-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    width: 100% !important;
    margin-top: 20px !important;
}

/* 3. Card Item - Strictly scoped to .related-tool-item */
.related-tool-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 12px 15px !important;
    text-decoration: none !important;
    height: 72px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

.related-tool-item:hover {
    transform: translateY(-2px) !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

/* 4. Icon Box - Scoped so it doesn't break the Main Upload Icon */
.related-tool-item .icon-wrapper {
    background: #eff6ff !important;
    color: #3b82f6 !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    margin-right: 12px !important;
    margin-bottom: 0 !important; /* Fixes the vertical pull in your screenshot */
}

.related-tool-item .icon-wrapper svg {
    width: 22px !important;
    height: 22px !important;
}

/* 5. Text Info - Scoped to avoid moving the "Select Images" text */
.related-tool-item .tool-info {
    text-align: left !important;
    flex: 1 !important;
}

.related-tool-item .tool-info h4 {
    margin: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #1e3a8a !important;
    line-height: 1.2 !important;
}

.related-tool-item .tool-info p {
    margin: 2px 0 0 !important;
    font-size: 0.75rem !important;
    color: #64748b !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* 6. Arrow - Scoped to avoid breaking FAQ icons */
.related-tool-item .arrow {
    margin-left: auto !important;
    color: #cbd5e1 !important;
    font-size: 1rem !important;
}

/* 7. Responsive Breakpoints */
@media (max-width: 992px) {
    .related-tools .tools-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

@media (max-width: 600px) {
    .related-tools .tools-grid { 
        grid-template-columns: 1fr !important; 
    }
    .related-tool-item { 
        height: auto !important; 
        padding: 15px !important;
    }
}