/* Ultra-Premium Apple-Tier Design System - DevPocket */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
    /* Apple iOS Timing Curve */
    --apple-curve: cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Light Theme (Apple-esque Snow & Silver) */
    --bg-color: #f5f5f7; 
    --card-bg: #ffffff;
    --text-color: #1d1d1f; 
    --text-muted: #86868b; 
    --primary: #0066cc; 
    --primary-hover: #0077ed;
    --border: rgba(0, 0, 0, 0.08); 
    
    /* Interactive states & glows */
    --ring-color: rgba(0, 102, 204, 0.2);
    --hover-glow: rgba(0, 0, 0, 0.02); 
    --gradient-brand: linear-gradient(135deg, #0066cc 0%, #2997ff 100%);
    
    /* Soft, dispersed Apple shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.08);
    --glass-border: rgba(255, 255, 255, 0.8);

    /* Layout */
    --card-radius: 24px;
    --input-radius: 14px;
    
    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, monospace;
}

body.dark {
    /* Dark Theme (True OLED Black & Deep Charcoal) */
    --bg-color: #000000;
    --card-bg: #111113; 
    --text-color: #f5f5f7; 
    --text-muted: #86868b; 
    --primary: #2997ff; 
    --primary-hover: #0077ed; 
    --border: rgba(255, 255, 255, 0.08); 
    
    --ring-color: rgba(41, 151, 255, 0.25);
    --hover-glow: rgba(255, 255, 255, 0.04);
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 30px 60px rgba(0,0,0,0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.5;
    transition: background-color 0.5s ease, color 0.5s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.container {
    max-width: 1040px; 
    margin: 0 auto;
    padding: 0 24px;
    flex: 1;
    width: 100%;
}

/* --- Header & Glassmorphism --- */
.site-header {
    background-color: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Hyper-vibrant Apple Glass */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--card-bg);
    opacity: 0.75;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    z-index: -1;
}

.header-content {
    max-width: 1040px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: -0.04em;
}

.emoji {
    font-size: 1.5rem;
}

.site-name {
    background: var(--gradient-brand);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-container {
    flex: 1;
    max-width: 340px;
    position: relative;
}

.search-container::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    opacity: 0.5;
    pointer-events: none;
}

.search-container input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border-radius: 9999px; /* Absolute pill shape */
    border: 1px solid var(--border);
    background-color: rgba(120, 120, 120, 0.05); /* very subtle fill */
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.4s var(--apple-curve);
}

.search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring-color);
    background-color: var(--card-bg);
}

#theme-toggle {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s var(--apple-curve);
}

#theme-toggle:hover {
    background-color: var(--hover-glow);
    color: var(--text-color);
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 100px 0 80px;
    position: relative;
}

/* Aesthetic spotlight glow */
.hero::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary);
    filter: blur(180px);
    opacity: 0.12;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 540px;
    margin: 0 auto;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
    padding-bottom: 100px;
}

.bento-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.5s var(--apple-curve), box-shadow 0.5s var(--apple-curve), border-color 0.4s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    will-change: transform, box-shadow;
}

.bento-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid var(--glass-border);
    pointer-events: none;
}

.bento-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255,255,255,0.2);
}

.card-icon {
    font-size: 1.5rem;
    color: var(--primary);
    background-color: rgba(120, 120, 120, 0.05);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-family: var(--font-mono);
    font-weight: 600;
    border: 1px solid var(--border);
}

.tool-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    z-index: 2;
    position: relative;
    letter-spacing: -0.03em;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    z-index: 2;
    position: relative;
    line-height: 1.5;
}

/* --- AdSense Placeholders --- */
.ads-placeholder {
    width: 100%;
    background-color: rgba(120, 120, 120, 0.02);
    border: 1px dashed var(--border);
    border-radius: var(--input-radius);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    display: none; 
    align-items: center;
    justify-content: center;
    min-height: 100px;
    margin: 40px 0;
}

/* --- Tool Pages Universal UI --- */
.tool-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 60px 0 32px;
    gap: 16px;
}

.tool-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.1;
}

.back-link {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background-color: rgba(0, 102, 204, 0.1);
    transition: all 0.3s var(--apple-curve);
}

.back-link:hover {
    background-color: rgba(0, 102, 204, 0.15);
    transform: translateX(-4px);
}

body.dark .back-link {
    background-color: rgba(41, 151, 255, 0.1);
}
body.dark .back-link:hover {
    background-color: rgba(41, 151, 255, 0.2);
}

.tool-workspace {
    display: grid;
    gap: 32px;
    margin-bottom: 80px;
}
.tool-workspace.two-pane {
    grid-template-columns: 1fr 1fr;
}

@media(max-width: 800px) {
    .tool-workspace.two-pane {
        grid-template-columns: 1fr;
    }
}

.pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pane label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
}

textarea, .tool-input {
    width: 100%;
    min-height: 400px;
    padding: 24px;
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all 0.4s var(--apple-curve);
    box-shadow: var(--shadow-sm);
}

textarea:focus, .tool-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring-color);
}

/* --- Buttons --- */
.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 999px; /* Pill shape for premium feel */
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--apple-curve);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px var(--ring-color);
}

.btn-secondary {
    background-color: rgba(120, 120, 120, 0.08);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: rgba(120, 120, 120, 0.15);
}

.how-to-use {
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 40px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.how-to-use::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--hover-glow), transparent);
    z-index: -1;
}

.how-to-use h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    font-weight: 600;
}

.how-to-use p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

.site-footer p {
    margin-bottom: 12px;
}

/* --- Mobile Responsiveness --- */
@media(max-width: 600px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    .hero h1 { font-size: 2.8rem; }
    .btn-group { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}

/* Tool specific metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.metric-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 24px 16px;
    border-radius: var(--card-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s var(--apple-curve);
}
.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: var(--shadow-md);
}
.metric-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-color);
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
