/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
  color: #4a4a4a;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.masthead {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  padding: 2rem 0;
  border-bottom: 1px solid #e5e5e5;
  background-color: #fafafa;
  margin-bottom: 2rem;
}

/* Navigation */
.navbar {
  background: none;
  border-bottom: 1px solid #e5e5e5;
  padding: 1rem 0;
  margin-bottom: 2rem;
}



.navbar-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}



.nav-link {
  color: #4a4a4a;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: #1a1a1a;
  background-color: #f5f5f5;
  text-decoration: none;
}



/* Breadcrumb */
.breadcrumb {
  font-size: 0.9rem;
  color: #6c757d;
}

.breadcrumb a {
  color: #007bff;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

input[type="text"], 
textarea, 
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1rem;
  background-color: #ffffff;
  color: #1a1a1a;
  transition: border-color 0.2s ease;
  min-height: 44px;
}

input[type="text"]:focus, 
textarea:focus, 
select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn-primary {
  background-color: #007bff;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #6c757d;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid #e5e5e5;
  color: #4a4a4a;
}

.btn-outline:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
  color: #007bff;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  min-height: 36px;
}

.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Cards */
.card {
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Article items */
.article-item {
  border-bottom: 1px solid #e5e5e5;
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
}

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

.article-item h2 {
  margin-bottom: 0.5rem;
}

.article-item h2 a {
  color: #1a1a1a;
  text-decoration: none;
}

.article-item h2 a:hover {
  color: #007bff;
}

.article-item h3 {
  margin-bottom: 0.5rem;
}

.article-item h3 a {
  color: #1a1a1a;
  text-decoration: none;
}

.article-item h3 a:hover {
  color: #007bff;
}

.article-item p {
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.article-meta {
  font-size: 0.875rem;
  color: #6c757d;
}

.article-meta a {
  color: #007bff;
  text-decoration: none;
}

.article-meta a:hover {
  text-decoration: underline;
}

/* Results and counters */
.counter {
  font-size: 0.875rem;
  color: #6c757d;
  text-align: right;
  margin-bottom: 1rem;
}

.result-box {
  background-color: #f8f9fa;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  min-height: 200px;
}

/* Loading states */
.loading {
  text-align: center;
  color: #6c757d;
  padding: 2rem;
}

/* Article content */
.article-content {
  line-height: 1.7;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 4px solid #007bff;
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #6c757d;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.article-content a {
  color: #007bff;
  text-decoration: none;
}

.article-content a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid #e5e5e5;
  background-color: #fafafa;
}

footer a {
  color: #007bff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Visitor Counter */
.visitor-counter {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.counter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #4a4a4a;
}

.counter-icon {
  font-size: 1.2rem;
  color: #007bff;
  width: 1.2rem;
  text-align: center;
}

.counter-icon i {
  font-size: 1.2rem;
}

.counter-label {
  font-weight: 500;
  color: #6c757d;
}

.counter-value {
  font-weight: 600;
  color: #007bff;
  font-size: 1rem;
}

/* AdSense Ad Containers */
.ad-container {
  margin: 2rem 0;
  text-align: center;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-container.sidebar-ad {
  margin: 1rem 0;
  padding: 0.5rem;
}

.ad-container.in-article-ad {
  margin: 1.5rem 0;
  background-color: transparent;
  border: none;
  padding: 0.5rem;
}

/* Mobile responsive ads */
@media (max-width: 768px) {
  .ad-container {
    margin: 1rem 0;
    padding: 0.5rem;
  }
}

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .masthead {
    font-size: 1.5rem;
    padding: 1.5rem 0;
  }
  

  
  .navbar-nav {
    gap: 1rem;
    justify-content: space-around;
  }
  

  
  .nav-link {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    flex: 1;
    min-width: 80px;
  }
  

  
  .btn-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .article-item {
    padding: 1rem 0;
    margin-bottom: 1rem;
  }
  
  .result-box {
    min-height: 150px;
    font-size: 0.8rem;
  }
  
  input[type="text"], 
  textarea, 
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .masthead {
    font-size: 1.25rem;
    padding: 1rem 0;
  }
  
  .navbar-nav {
    gap: 0.5rem;
  }
  
  .visitor-info {
    font-size: 0.75rem;
    gap: 0.25rem;
  }
  
  .country-display,
  .time-display {
    padding: 0.15rem 0.3rem;
  }
  
  .nav-link {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
    min-width: 60px;
  }
  
  .visitor-counter {
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem;
  }
  
  .counter-item {
    font-size: 0.8rem;
  }
  
  .card {
    padding: 1rem;
    border-radius: 8px;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  .result-box {
    padding: 0.75rem;
    font-size: 0.75rem;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }
  
  .nav-link:hover {
    background-color: transparent;
  }
  
  .article-item h2 a:hover,
  .article-item h3 a:hover {
    color: #1a1a1a;
  }
  
  .btn-outline:hover {
    background-color: transparent;
    border-color: #e5e5e5;
    color: #4a4a4a;
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.w-100 {
  width: 100%;
}

/* Focus styles for accessibility */
.btn:focus,
.nav-link:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .navbar,
  .btn-group,
  .masthead {
    display: none;
  }
  
  .card {
    border: none;
    box-shadow: none;
    padding: 0;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #007bff;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* Pagination */
.pagination-wrapper {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page-numbers {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  color: var(--link-color);
  text-decoration: none;
  font-size: 0.9rem;
  min-width: 2.5rem;
  text-align: center;
}

.page-link:hover {
  background-color: var(--bg-hover);
  border-color: var(--primary-color);
}

.current-page {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--primary-color);
  border-radius: 0.25rem;
  background-color: var(--primary-color);
  color: white;
  font-size: 0.9rem;
  min-width: 2.5rem;
  text-align: center;
}

@media (max-width: 768px) {
  .pagination {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .page-numbers {
    gap: 0.25rem;
  }
  
  .page-link,
  .current-page {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    min-width: 2rem;
  }
}
  