/**
 * CCTNS Portal Design System - Main Stylesheet
 * =============================================
 * Rajasthan Police CCTNS Resource Portal
 *
 * Import order matters:
 * 1. tokens.css - Design tokens (CSS custom properties)
 * 2. base.css - Reset and foundational styles
 * 3. components.css - UI components
 * 4. layout.css - Page structure
 */

@import url('tokens.css');
@import url('base.css');
@import url('components.css');
@import url('layout.css');

/* ========================================
   GOOGLE FONTS IMPORT
   ======================================== */

/*
 * For production, preload fonts in HTML head for better performance:
 * <link rel="preconnect" href="https://fonts.googleapis.com">
 * <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 * <link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap" rel="stylesheet">
 */

/* ========================================
   PAGE-SPECIFIC STYLES
   ======================================== */

/* Home Page - Service Cards Grid */
.services-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(1, 1fr);
}

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

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

/* Tools Grid */
.tools-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Downloads Grid */
.downloads-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(1, 1fr);
}

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

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

/* ========================================
   FONT CONVERTER PAGE
   ======================================== */

.converter-container {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .converter-container {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

.converter-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.converter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.converter-panel-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.converter-textarea {
  min-height: 200px;
  font-family: var(--font-hindi);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

.converter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.converter-char-count {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.converter-actions {
  display: flex;
  gap: var(--space-2);
}

.converter-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  justify-content: center;
  padding: var(--space-4) 0;
}

@media (min-width: 768px) {
  .converter-buttons {
    flex-direction: row;
  }
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-8);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.login-logo img {
  height: 64px;
  width: auto;
}

.login-title {
  text-align: center;
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-links {
  text-align: center;
  margin-top: var(--space-4);
}

.login-help {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ========================================
   DOWNLOADS PAGE
   ======================================== */

.download-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.download-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.download-card .card-description {
  flex: 1;
}

.download-card .card-footer {
  margin-top: auto;
}

.download-category {
  margin-bottom: var(--space-8);
}

.download-category:last-child {
  margin-bottom: 0;
}

.download-category-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border-default);
}

/* ========================================
   NOTICE BAR
   ======================================== */

.notice-bar {
  background-color: var(--color-warning-50);
  border-bottom: 1px solid var(--color-warning-500);
  padding: var(--space-3) var(--space-4);
}

.notice-bar-container {
  max-width: var(--max-w-7xl);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.notice-bar-icon {
  flex-shrink: 0;
  color: var(--color-warning-600);
}

.notice-bar-icon svg {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
}

.notice-bar-content {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-warning-700);
}

.notice-bar-dismiss {
  flex-shrink: 0;
  padding: var(--space-1);
  background: none;
  border: none;
  color: var(--color-warning-600);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.notice-bar-dismiss:hover {
  background-color: var(--color-warning-100);
}

/* ========================================
   EXTERNAL LINK ICON UTILITY
   ======================================== */

.external-link-icon {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: var(--space-1);
  vertical-align: middle;
}

/* ========================================
   ICON LIBRARY (Simple SVG Icons)
   ======================================== */

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.icon-md { width: var(--icon-size-md); height: var(--icon-size-md); }
.icon-lg { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.icon-xl { width: var(--icon-size-xl); height: var(--icon-size-xl); }

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .header,
  .footer,
  .mobile-nav,
  .skip-link,
  .btn,
  .notice-bar {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* ========================================
   CUSTOM SCROLLBAR (Optional)
   ======================================== */

@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--color-neutral-300);
    border-radius: var(--radius-full);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-400);
  }
}
