/* Rakha PDF - Unified Design System & Modern Theme */

:root {
  --primary-blue: #2563EB;
  --brand-blue: #1E3A8A;
  --sky-blue: #0EA5E9;
  --brand-sky: #38BDF8;
  --accent-pink: #EC4899;
  --brand-pink: #EC4899;
  --dark-navy: #0F172A;
  --brand-dark: #0F172A;
  --light-gray: #F8FAFC;
  --medium-gray: #E2E8F0;
  --border-color: #E2E8F0;
  --text-gray: #64748B;
  --text-dark: #1E293B;
  --success-green: #10B981;
  --warning-orange: #F59E0B;
  --error-red: #EF4444;
  --gradient-primary: linear-gradient(135deg, #1E3A8A 0%, #0EA5E9 100%);
  --gradient-accent: linear-gradient(135deg, #0EA5E9 0%, #EC4899 100%);
  --gradient-compress: linear-gradient(135deg, #38BDF8 0%, #2563EB 100%);
  --gradient-purple: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.12);
}

/* Base Body Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  background: radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.06) 0%, transparent 40%),
              #F8FAFC !important;
  color: var(--text-dark);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  padding-top: 76px !important;
  display: flex;
  flex-direction: column;
}

/* Hide old redundant header/footer elements that clash with beast components */
body > header:not(.beast-header),
body > footer:not(.beast-footer) {
  display: none !important;
}

/* Unified Beast Header */
.beast-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  z-index: 1000;
  transition: all 0.3s ease;
}

.beast-header-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.beast-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.25s ease;
}

.beast-logo:hover {
  transform: scale(1.02);
}

.beast-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.25);
}

.beast-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.beast-nav-item {
  position: relative;
}

.beast-nav-btn {
  background: none;
  border: none;
  color: var(--dark-navy);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.beast-nav-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--brand-blue);
}

/* Mega Dropdown Menu */
.beast-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  width: 820px;
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.16);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1005;
}

.beast-nav-item:hover .beast-dropdown-menu,
.beast-nav-item:focus-within .beast-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.beast-tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--dark-navy);
  transition: all 0.2s ease;
}

.beast-tool-item:hover {
  background: #F1F5F9;
  transform: translateX(4px);
}

.beast-tool-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.beast-tool-item-info {
  display: flex;
  flex-direction: column;
}

.beast-tool-name {
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
}

.beast-tool-desc {
  font-size: 11.5px;
  color: #64748B;
}

/* Mobile Toggle */
.beast-mobile-btn {
  display: none;
  background: none;
  border: none;
  color: var(--dark-navy);
  font-size: 24px;
  cursor: pointer;
}

.beast-mobile-drawer {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  z-index: 999;
  overflow-y: auto;
  padding: 24px;
}

.beast-mobile-drawer.active {
  display: block;
}

@media (max-width: 900px) {
  .beast-nav-links {
    display: none;
  }
  .beast-mobile-btn {
    display: block;
  }
}

/* Main Container & Page Layout */
.main-container {
  max-width: 1100px !important;
  margin: 0 auto !important;
  padding: 30px 24px 60px 24px !important;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

.tool-header {
  text-align: center;
  margin-bottom: 34px;
}

.tool-header h1, .tool-title {
  font-size: 38px !important;
  font-weight: 800 !important;
  color: var(--dark-navy) !important;
  margin-bottom: 12px !important;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.tool-header h1::after, .tool-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 4px;
}

.tool-header p, .tool-description {
  font-size: 16px !important;
  color: var(--text-gray) !important;
  max-width: 680px;
  margin: 14px auto 0 auto !important;
  line-height: 1.6;
}

/* Modern Upload Container */
.upload-container, .upload-area {
  background: #ffffff !important;
  border-radius: 24px !important;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.06) !important;
  padding: 50px 30px !important;
  text-align: center !important;
  border: 2px dashed #93C5FD !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  margin-bottom: 30px !important;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: #2563EB !important;
  background: rgba(239, 246, 255, 0.8) !important;
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.12) !important;
}

.upload-icon {
  width: 76px !important;
  height: 76px !important;
  background: var(--gradient-primary) !important;
  border-radius: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto 18px auto !important;
  color: #fff !important;
  font-size: 32px !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28) !important;
}

.upload-text h2, .upload-text h3 {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--dark-navy) !important;
  margin-bottom: 8px !important;
}

.upload-text p {
  font-size: 14.5px !important;
  color: var(--text-gray) !important;
}

.btn-upload, .select-button {
  background: var(--gradient-primary) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  padding: 14px 32px !important;
  border-radius: 14px !important;
  border: none !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 20px !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25) !important;
  transition: all 0.25s ease !important;
}

.btn-upload:hover, .select-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35) !important;
}

/* FIX 2: Processing Overlay Must Be Top-Level & Cover Screen Seamlessly */
.processing-overlay {
  z-index: 100000 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  display: none;
  align-items: center;
  justify-content: center;
}

.processing-overlay.active {
  display: flex !important;
}

.processing-content {
  background: #ffffff !important;
  border-radius: 24px !important;
  padding: 40px !important;
  max-width: 460px !important;
  width: 90% !important;
  text-align: center !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3) !important;
  animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.processing-text {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--dark-navy) !important;
  margin: 18px 0 8px 0 !important;
}

.processing-status {
  font-size: 14px !important;
  color: var(--text-gray) !important;
}

.progress-bar {
  height: 10px !important;
  background: #E2E8F0 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  margin: 16px auto !important;
  width: 100% !important;
}

.progress-fill {
  height: 100% !important;
  background: var(--gradient-primary) !important;
  width: 0%;
  border-radius: 10px !important;
  transition: width 0.3s ease !important;
}

/* FIX 4: COMPRESS PDF PREMIUM CARD UI */
.file-info-card {
  background: #ffffff !important;
  border-radius: 20px !important;
  padding: 24px 30px !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
  margin-bottom: 30px !important;
}

.compression-levels {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
  margin-top: 20px !important;
}

.compression-option {
  background: #F8FAFC !important;
  border: 2px solid #E2E8F0 !important;
  border-radius: 18px !important;
  padding: 24px 20px !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  text-align: center !important;
  position: relative;
}

.compression-option:hover {
  border-color: #38BDF8 !important;
  background: #ffffff !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.15) !important;
}

.compression-option.selected {
  border-color: #2563EB !important;
  background: #EFF6FF !important;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18) !important;
}

.compression-icon {
  width: 56px !important;
  height: 56px !important;
  border-radius: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto 14px auto !important;
  color: #fff !important;
  font-size: 24px !important;
}

.compression-option h4 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: var(--dark-navy) !important;
  margin-bottom: 6px !important;
}

.compression-option p {
  font-size: 13px !important;
  color: var(--text-gray) !important;
  margin-bottom: 14px !important;
}

.compression-stats {
  display: flex !important;
  justify-content: space-around !important;
  border-top: 1px solid #E2E8F0 !important;
  padding-top: 12px !important;
}

.stat-item .stat-label {
  font-size: 11px !important;
  color: #94A3B8 !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
}

.stat-item .stat-value {
  font-size: 15px !important;
  font-weight: 800 !important;
}

/* FIX 5: HOMEPAGE PREMIUM MODERN STYLING */
.home-hero-wrap {
  text-align: center;
  padding: 50px 20px 40px 20px;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: #2563EB;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 22px;
}

.home-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;
  color: #0F172A;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.home-subtitle {
  font-size: 18px;
  color: #64748B;
  max-width: 660px;
  margin: 0 auto 34px auto;
  line-height: 1.6;
}

.home-categories-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.home-cat-pill {
  padding: 10px 20px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #E2E8F0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.home-cat-pill:hover {
  border-color: #38BDF8;
  color: #0284C7;
  transform: translateY(-1px);
}

.home-cat-pill.active {
  background: #0F172A;
  color: #ffffff;
  border-color: #0F172A;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}

/* Beautiful Tool Grid for Homepage */
.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px 60px 20px;
}

.home-tool-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid #F1F5F9;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
}

.home-tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
  border-color: #E2E8F0;
}

.home-tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  margin-bottom: 16px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease;
}

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

.home-tool-title {
  font-size: 17px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
}

.home-tool-desc {
  font-size: 13px;
  color: #64748B;
  line-height: 1.5;
}

/* Unified Beast Footer */
.beast-footer {
  background: #0B1329;
  color: #E2E8F0;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 60px 0 30px 0;
}

.beast-footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.beast-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 50px;
}

.beast-footer-brand h4 {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.beast-footer-brand p {
  color: #94A3B8;
  font-size: 14px;
  line-height: 1.6;
  max-width: 320px;
}

.beast-footer-col h5 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 18px;
}

.beast-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.beast-footer-links a {
  color: #94A3B8;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.beast-footer-links a:hover {
  color: #38BDF8;
  transform: translateX(4px);
}

.beast-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: #64748B;
  font-size: 13.5px;
}

@media (max-width: 900px) {
  .beast-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .compression-levels {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .beast-footer-grid {
    grid-template-columns: 1fr;
  }
}
