/* 
  CALC.ZIP Premium V2.1 Styling System
  Adding micro-interactions for advertisements and the elegant news modal popup window.
*/

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

:root {
  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Sleek Dark Mode Color Palette */
  --bg-base: #0b0f19; 
  --bg-surface: rgba(22, 30, 49, 0.7); 
  --bg-surface-solid: #161e31;
  
  --primary: hsl(224, 100%, 60%); 
  --primary-glow: hsla(224, 100%, 60%, 0.15);
  --accent: hsl(263, 90%, 51%); 
  
  --text-main: #f8fafc; 
  --text-muted: #94a3b8; 
  
  --border: rgba(255, 255, 255, 0.06);
  --border-focus: hsla(224, 100%, 60%, 0.5);
  
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  
  --success: #10b981; 
  --warning: #f59e0b; 
  
  /* Tile Custom HSL colors for beautiful premium grid */
  --tile-blue: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  --tile-purple: linear-gradient(135deg, #581c87 0%, #6d28d9 100%);
  --tile-teal: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  --tile-pink: linear-gradient(135deg, #9d174d 0%, #be185d 100%);
  --tile-green: linear-gradient(135deg, #065f46 0%, #059669 100%);
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 0% 0%, hsla(244,20%,10%,1) 0, transparent 60%),
    radial-gradient(at 50% 50%, hsla(224,40%,15%,0.3) 0, transparent 60%),
    radial-gradient(at 100% 0%, hsla(263,70%,20%,0.15) 0, transparent 60%);
  background-attachment: fixed;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

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

/* Header V2 - Mega Menu Nav */
header {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
}

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

.logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo span {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Mega Nav Links */
.mega-nav {
  display: none;
  list-style: none;
  align-items: center;
  gap: 20px;
}

@media (min-width: 1024px) {
  .mega-nav {
    display: flex;
  }
}

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

.mega-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mega-nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.03);
}

/* Main Layout: Sidebar + Content Grid */
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 40px 0 60px;
}

@media (min-width: 1024px) {
  .main-layout {
    grid-template-columns: 240px 1fr;
  }
}

/* Floating Sidebar (바로가기) */
.sidebar-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  height: fit-content;
  position: sticky;
  top: 90px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-item-btn {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-item-btn:hover {
  color: white;
  border-color: var(--border-focus);
  background: var(--primary-glow);
}

/* Grid Menu System */
.grid-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 640px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .menu-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Colored Calculator Tiles */
.menu-tile {
  border-radius: 16px;
  padding: 20px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.menu-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.03);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-tile:hover::before {
  opacity: 1;
}

.menu-tile:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  border-color: rgba(255,255,255,0.2);
}

.menu-tile.active {
  box-shadow: 0 0 0 3px var(--primary), var(--glass-shadow);
  transform: translateY(-2px);
}

.tile-icon {
  font-size: 28px;
  color: white;
}

.tile-info {
  margin-top: 12px;
}

.tile-title {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.tile-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* Color Classes */
.t-blue { background: var(--tile-blue); }
.t-purple { background: var(--tile-purple); }
.t-teal { background: var(--tile-teal); }
.t-pink { background: var(--tile-pink); }
.t-green { background: var(--tile-green); }

/* Dynamic Calculator Form Container */
.active-calculator-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--glass-shadow);
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.active-calculator-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.calc-form-content {
  display: none;
}

.calc-form-content.active {
  display: block;
}

/* Forms & Result Elements (Same beautiful styles) */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-control {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-family: var(--font-main);
  font-size: 16px;
  color: var(--text-main);
  outline: none;
  transition: all 0.3s ease;
}

.input-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.select-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px;
  padding-right: 48px;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1);
}

.result-box {
  margin-top: 24px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: none;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--text-muted);
}

.result-value {
  font-weight: 700;
  color: var(--success);
}

/* Military Progress Bar */
.progress-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  height: 20px;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  border-radius: 10px;
  transition: width 1s ease;
}

.progress-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* News Section */
.news-anchor {
  padding: 60px 0 100px;
  border-top: 1px solid var(--border);
}

.news-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 32px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.news-title i {
  color: var(--warning);
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.news-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.news-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--primary-glow);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.news-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.news-category.traffic {
  color: var(--warning);
  background: hsla(38, 92%, 50%, 0.15);
}

.news-header {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  color: white;
  line-height: 1.4;
}

.news-body {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* Mega Link Advertisement Hover Effect */
.ad-banner-link {
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
}

.ad-banner-link:hover {
  transform: scale(1.015);
}

.ad-banner-link:hover .ad-box-content {
  filter: brightness(1.15);
  box-shadow: 0 8px 25px rgba(29, 78, 216, 0.3);
}

/* DYNAMIC NEWS MODAL POPUP */
.news-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.news-modal-content {
  background: #121826;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px;
  max-width: 650px;
  width: 90%;
  box-shadow: var(--glass-shadow);
  position: relative;
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.news-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.news-modal-close-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.news-modal-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  transform: rotate(90deg);
}

.modal-article-body {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.8;
  color: #cbd5e1;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 8px;
}

.modal-article-body::-webkit-scrollbar {
  width: 6px;
}
.modal-article-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Footer & Legal Links */
.footer {
  padding: 40px 0 80px;
  border-top: 1px solid var(--border);
  text-align: center;
  margin-top: 40px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.footer-links a:hover {
  color: white;
  text-shadow: 0 0 10px var(--primary-glow);
}

.footer-divider {
  color: rgba(255, 255, 255, 0.15);
  font-size: 13px;
  user-select: none;
}

.footer-copyright {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.5);
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* --- PREMIUM RECOMMEND BUTTON --- */
.premium-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 32px 0 24px 0;
}

.premium-recommend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none !important;
  padding: 16px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3), inset 0 -2px 0px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 100%;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.premium-recommend-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5), inset 0 -2px 0px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff !important;
}

.premium-recommend-btn:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2), inset 0 -1px 0px rgba(0, 0, 0, 0.2);
}

.premium-recommend-btn .btn-emoji {
  font-size: 18px;
  animation: bounceHorizontal 1.2s infinite;
  display: inline-block;
}

@keyframes bounceHorizontal {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

@media (max-width: 640px) {
  .premium-recommend-btn {
    font-size: 14px;
    padding: 14px 20px;
    width: 100%;
    border-radius: 14px;
  }
}

