@import url("https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap");
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  
  /* Background Colors */
  --bg-color: #FEF9F1;     
  --sidebar-bg: #5C3A21;   
  
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --header-height: 72px;
  --sidebar-width: 100px;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Comic font ab yahan lagaya hai taaki icons kharab na hon */
  font-family: 'Comic Neue', cursive;
}

/* Header Full Width (Top) */
.govt-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #1e293b;
  color: #ffffff;
  padding: 15px 40px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  border-bottom: 3px solid var(--primary-color);
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-logo i {
  font-size: 35px;
  color: #38bdf8;
}

.brand-logo h1 {
  font-size: 20px;
  font-weight: 700;
}

.brand-logo p {
  font-size: 12px;
  color: #94a3b8;
}

/* Sidebar (Header ke neeche) */
#sidebar-placeholder {
  position: fixed;
  left: 0;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  z-index: 900;
}

.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  overflow-y: auto;
  box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.app-sidebar::-webkit-scrollbar { width: 4px; }
.app-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; }

.app-sidebar .nav-item {
  width: 85px;
  height: 80px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e2e8f0; 
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.app-sidebar .nav-icon-box {
  font-size: 24px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-sidebar .nav-item span {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.app-sidebar .nav-item:hover, .app-sidebar .nav-item.active {
  background: rgba(255, 255, 255, 0.15); 
  color: #ffffff;
}

/* Content Wrapper */
.content-wrapper {
  margin-top: var(--header-height);
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  display: flex;
  flex-direction: column;
}

.main-content {
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.workspace-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.03);
}

.tool-header-info {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.tool-logo-box {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-logo-box i {
  font-size: 30px;
  color: var(--primary-color);
}

.upload-area {
  border: 2px dashed #93c5fd;
  background: #fafafa;
  padding: 80px 40px;
  min-height: 350px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.upload-area:hover {
  background: #eff6ff;
  border-color: var(--primary-color);
}

.upload-icon {
  font-size: 55px;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.upload-area h4 {
  font-size: 22px;
  margin-bottom: 8px;
}

.select-file-btn {
  display: inline-block;
  margin-top: 25px;
  background: var(--primary-color);
  color: #fff;
  padding: 14px 35px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

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

#fileInput { display: none; }

.file-details {
  margin-top: 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-color);
}

.primary-btn {
  width: 100%;
  padding: 18px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: 0.2s;
}

.primary-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* Comic Back to Home Button with Black Border */
.comic-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 25px auto 0 auto;
  color: var(--text-main);
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  border: 2px solid #000000;
  padding: 12px 25px;
  border-radius: 10px;
  background: #ffffff;
  width: max-content;
  transition: all 0.2s ease;
  box-shadow: 2px 2px 0px rgba(0,0,0,1);
}

.comic-back-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px rgba(0,0,0,1);
}

.loader-box {
  display: none;
  text-align: center;
  padding: 30px;
}

.progress-circle {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 15px;
}

.circle-bg { fill: none; stroke: #e2e8f0; stroke-width: 8; }
.circle-stroke {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.1s linear;
}

#progressPercentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 22px;
  color: var(--primary-color);
}

.result-box { display: none; margin-top: 30px; }

.button-bar {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  color: white;
  font-size: 15px;
}

.preview-btn { background: #6366f1; }
.download-btn { background: #16a34a; }
.print-btn { background: #0284c7; }

.cards-preview-wrap {
  display: flex;
  gap: 25px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 30px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.cr80-card {
  width: 330px;
  height: 205px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}

.card-tag {
  background: #1e293b;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 5px;
  text-align: center;
}

.card-canvas-box {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-canvas-box canvas, .card-canvas-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  #sidebar-placeholder { display: none; }
  .content-wrapper { margin-top: var(--header-height); margin-left: 0; width: 100%; }
  .main-content { padding: 20px; }
  .upload-area { min-height: 250px; padding: 40px 20px; }
}