/* 
  PixTools - Main Stylesheet
  Core design system for the Image Tools Website
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Light Mode Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    /* Dark Mode Palette */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-hover: #60a5fa;
    --border-color: #334155;
    --card-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navigation */
header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-toggle {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border-radius: 9999px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 4rem 0;
}

.tool-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 1rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
    border-color: var(--accent-primary);
}

.tool-icon {
    width: 3rem;
    height: 3rem;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.tool-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Why PixTools Section */
.why-section {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
}

.feature-icon {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

/* Tool Page Specific Styles */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 992px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }
}

.upload-area {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 4rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area.drag-over {
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
}

.preview-box {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-header {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}

.preview-content {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.controls-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 1rem;
    height: fit-content;
    position: sticky;
    top: 6rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
}

.faq-item {
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.faq-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Footer */
footer {
    margin-top: auto;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    display: block;
}

.footer-links h4 {
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Badges */
.badge-private {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Slider Customization */
input[type="range"] {
    width: 100%;
    accent-color: var(--accent-primary);
}

input[type="number"], select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 0.4rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ANIMATIONS */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Scroll Progress Bar */
.scroll-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, #2563EB, #60a5fa);
  width: 0%;
  z-index: 101;
  transition: width 0.1s linear;
}

/* FadeUp Keyframe */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero Entry */
.hero h1 {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.hero p {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.search-container {
  animation: fadeUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

/* Tool Cards - start visible, animate in */
.tool-card {
  opacity: 0;
  transform: translateY(20px);
  transition: 
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.tool-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.15);
}

/* Feature Items */
.feature-item {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tool Icon Hover */
.tool-icon {
  transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
  transform: scale(1.1);
}

/* Button Hover */
.btn-primary {
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

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

/* Upload Zone */
.upload-area {
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.upload-area:hover {
  border-color: var(--accent-primary);
  background: rgba(37, 99, 235, 0.04);
}

.upload-area.drag-over {
  border-color: var(--accent-primary);
  background: rgba(37, 99, 235, 0.06);
  transform: scale(1.01);
}

/* Navbar blur */
header {
  backdrop-filter: blur(12px);
  transition: box-shadow 0.3s ease;
}

/* CATEGORY TABS REDESIGN */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 1.5rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  border-radius: 1rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cat-tab i {
  font-size: 1.25rem;
}

.cat-tab:hover:not(.coming-soon) {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}

.cat-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  transform: translateY(-2px);
}

.cat-tab.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
}

.soon-badge {
  font-size: 0.7rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-color);
  margin-left: 0.25rem;
}

.cat-tab.active .soon-badge {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
  border-color: transparent;
}

/* PLACEHOLDER PANELS */
.placeholder-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
  gap: 1.5rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--card-shadow);
  animation: fadeUp 0.5s ease;
}

.placeholder-panel .icon-glow {
  width: 5rem;
  height: 5rem;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  position: relative;
}

.placeholder-panel .icon-glow::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--accent-primary);
  filter: blur(20px);
  opacity: 0.2;
  border-radius: 50%;
  z-index: 0;
}

.placeholder-panel i {
  font-size: 2.5rem;
  color: var(--accent-primary);
  z-index: 1;
}

.placeholder-panel h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.placeholder-panel p {
  font-size: 1.1rem;
  max-width: 400px;
}

