/* 
   Premium Grayscale Tool - Main Styles
   Theme: Midnight Glass & Vibrant Accents
*/

:root {
    /* Core Palette - Deep Space Theme */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;

    --primary: #3b82f6;
    /* Blue 500 */
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary: #8b5cf6;
    /* Violet 500 */

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --success: #10b981;
    --danger: #ef4444;

    /* Metrics */
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 4px;

    --shadow-main: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Typeography & Header --- */
.main-header {
    padding: 20px 0;
    backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

/* --- Hero Section --- */
.hero-section {
    padding: 60px 0 40px;
    text-align: center;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    display: inline-block;
    /* Ensure block model matches */
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 30px;
}

.benefit-list {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.benefit-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Tool Interface Grid --- */
.tool-wrapper {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    min-height: 400px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

/* 1. Upload View */
.upload-area {
    padding: 80px 20px;
    border: 2px dashed var(--bg-input);
    border-radius: var(--radius-lg);
    margin: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.icon-upload {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 20px;
    border-radius: 50%;
    margin-bottom: 10px;
}

/* 2. Editor View */
.tool-editor {
    display: flex;
    height: 100%;
    min-height: 500px;
}

.editor-layout {
    display: flex;
    width: 100%;
}

.preview-container {
    flex: 1;
    background: #0b1120;
    /* Darker than bg */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.img-container {
    max-width: 100%;
    max-height: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.img-container img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.controls-panel {
    width: 320px;
    background: var(--bg-card);
    border-left: var(--glass-border);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
}

.control-group h4 {
    margin-bottom: 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* Inputs */
.premium-select,
.toggle-switch {
    width: 100%;
}

.premium-select {
    background: var(--bg-input);
    border: 1px solid transparent;
    color: white;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
}

.premium-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Custom Grayscale Selectors */
.grid-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-card {
    background: var(--bg-input);
    border: 1px solid transparent;
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.option-card:hover {
    background: #475569;
}

.option-card input {
    display: none;
}

.option-card.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
    color: white;
}

.option-icon {
    font-size: 1.2rem;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* Result View */
.result-view {
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(to bottom, var(--bg-card), #111827);
}

.result-display {
    padding: 20px;
    background: #000;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

.stats-row {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.stats-row .value {
    color: var(--success);
    font-weight: bold;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* SEO Content */
.seo-content {
    padding: 60px 0;
    background: #0b1120;
    margin-top: 60px;
}

.content-block {
    max-width: 800px;
    margin: 0 auto 50px;
}

.content-block h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #e2e8f0;
}

.text-content p {
    margin-bottom: 1.5em;
    color: #cbd5e1;
}

/* --- Semantic Layout Improvements --- */
.faq-section {
    margin: 80px 0;
    position: relative;
    padding-bottom: 40px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    /* Wider cards */
    gap: 25px;
    margin-top: 50px;
}

.faq-item {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Subtle glow effect on hover */
.faq-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.3);
}

.faq-item:hover::before {
    opacity: 1;
}

.faq-item h4 {
    margin-bottom: 12px;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
    display: flex;
    align-items: start;
    gap: 12px;
}

/* Add a visual icon before questions */
.faq-item h4::before {
    content: '?';
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 24px;
    height: 24px;
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 800;
    margin-top: 2px;
}

.faq-item p {
    color: #94a3b8;
    font-size: 0.95rem;
    padding-left: 36px;
    /* Align with text start */
    line-height: 1.7;
}

/* Explore More Tools Section */
.internal-links-block {
    margin-top: 80px;
    padding: 60px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.8));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.internal-links-block h3 {
    font-size: 2rem;
    margin-bottom: 40px;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.tool-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tool-link-card:hover {
    transform: translateY(-5px);
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.3);
}

.tool-link-card strong {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.tool-link-card span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer Premium */
.main-footer {
    padding: 80px 0 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to top, #020617, #0f172a);
    margin-top: 0;
    color: var(--text-muted);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    margin-bottom: 15px;
    display: inline-block;
}

.footer-brand p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #64748b;
}

.footer-col h4 {
    color: #e2e8f0;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: #475569;
}