/*
 * RiazHub.com - Main Stylesheet
 * Single-Page Utility Directory & WordPress Theme
 * Founder: MUHAMMAD RIAZ Khan Jee (Khan Jee)
 */

:root {
  /* Color Palette */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: #1f2937;
  --bg-glass: rgba(17, 24, 39, 0.65);
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
  --accent-gradient-hover: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #0891b2 100%);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Core Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-blue);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* Full Width Container */
.riazhub-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Glass Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  transition: var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-badge {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

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

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  align-items: center;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--border-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

/* AdSense Reserved Zones (Fixed height to eliminate CLS) */
.adsense-zone {
  width: 100%;
  margin: 1.5rem 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.adsense-zone::after {
  content: 'ADVERTISEMENT - ADSENSE AUTO / MANUAL ZONE';
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.adsense-zone.header-banner {
  min-height: 90px;
}

.adsense-zone.infeed-banner {
  min-height: 250px;
  margin: 2.5rem 0;
}

.adsense-zone.footer-banner {
  min-height: 90px;
  margin-top: 2rem;
}

/* Hero Section & Real-time Live Search */
.hero-section {
  padding: 3rem 0 2rem 0;
  text-align: center;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2rem auto;
}

.founder-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Real-Time Live Search Container */
.search-container {
  max-width: 650px;
  margin: 0 auto;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  font-size: 1.25rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 1.1rem 3.5rem 1.1rem 3.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
  background: var(--bg-secondary);
}

.search-clear-btn {
  position: absolute;
  right: 1.25rem;
  background: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

/* Category Filter Toolbar & Layout View Switcher */
.toolbar-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 2rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.category-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.category-filters::-webkit-scrollbar {
  height: 4px;
}

.category-filters::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.filter-btn {
  white-space: nowrap;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.filter-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Layout Switcher (Grid vs List) */
.layout-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.view-btn {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.view-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Customizable Widget Zones (.widget-zone) */
.widget-zone {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.widget-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gradient);
}

.widget-zone .widget-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Tools Directory Grid & List Layouts */
.tools-directory {
  margin: 1.5rem 0 3rem 0;
  transition: var(--transition);
}

/* GRID VIEW */
.tools-directory.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.tools-directory.grid-view .tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}

.tools-directory.grid-view .tool-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* LIST VIEW */
.tools-directory.list-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tools-directory.list-view .tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: var(--transition);
}

.tools-directory.list-view .tool-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

/* Tool Card Contents */
.tool-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.list-view .tool-header {
  margin-bottom: 0;
  flex: 1;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tool-meta {
  display: flex;
  flex-direction: column;
}

.tool-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.tool-category-badge {
  display: inline-block;
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

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

.list-view .tool-description {
  margin-bottom: 0;
  flex: 2;
}

.tool-action-btn {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.tool-action-btn:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-sm);
}

.list-view .tool-action-btn {
  width: auto;
  padding: 0.6rem 1.25rem;
  flex-shrink: 0;
}

/* Zero Results Notice */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: none;
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Modals & Utility Workspace Panel */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal-window {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-close-btn {
  background: var(--bg-input);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

/* Tool Interface Forms & Elements */
.tool-ui-group {
  margin-bottom: 1.25rem;
}

.tool-ui-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.tool-ui-input, .tool-ui-select, .tool-ui-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
}

.tool-ui-input:focus, .tool-ui-select:focus, .tool-ui-textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tool-ui-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: monospace;
}

.tool-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.tool-btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.tool-btn:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
}

.tool-btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.tool-btn-secondary:hover {
  background: var(--border-color);
}

.tool-result-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.tool-result-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-result-val {
  font-family: monospace;
  font-size: 1.1rem;
  color: #4ade80;
  word-break: break-all;
  white-space: pre-wrap;
}

/* Footer Section */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem 0;
}

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

.footer-founder-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .hero-title {
    font-size: 2.25rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .header-nav .nav-links {
    display: none; /* Mobile menu can toggle */
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
  }
  .layout-switcher {
    align-self: flex-end;
  }
  .tools-directory.grid-view {
    grid-template-columns: 1fr;
  }
  .tools-directory.list-view .tool-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .list-view .tool-action-btn {
    width: 100%;
  }
}
