:root {
    --primary-color: #1976D2;
    --primary-light: #42a5f5;
    --primary-dark: #0d47a1;
    --secondary-color: #9CC1E8;
    --secondary-dark: #4e96e3;
    --background-color: #F8F9FA;
    --text-color: #333;
    --light-text: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --surface: #ffffff;
    --surface-hover: #f5f5f5;
    --on-primary: #ffffff;
    --on-secondary: #000000;
    --on-surface: #212121;
    --outline: #e0e0e0;
    --elevation-1: 0 1px 3px rgba(0,0,0,0.12);
    --elevation-2: 0 2px 6px rgba(0,0,0,0.15);
}

/* Page Title Styles */
.page-title-container {
    background-color: var(--secondary-color);
    color: var(--on-secondary);
    padding: 0.75rem 2rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--elevation-2);
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-title::before {
    content: "";
    width: 4px;
    height: 2rem;
    background-color: var(--primary-color);
    border-radius: 2px;
    margin-right: 0.75rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

body.touch-screen { min-height: 200vh; }
body.touch-screen::-webkit-scrollbar { display: always; }
body.touch-screen { 
    scrollbar-width: auto; 
} /* For Firefox */

.container.mt-4 {
    margin-top: 0.5rem!important;
}

.navbar {
    background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card {
    box-shadow: var(--box-shadow);
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: transform var(--transition-speed);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn {
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    transition: all var(--transition-speed);
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Form Styles */
.form-control {
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    transition: border-color var(--transition-speed);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(15, 76, 129, 0.25);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1.5rem;
    }

    .card:hover {
        transform: none;
    }
}

/* Accessibility Improvements */
:focus {
    outline: 3px solid rgba(15, 76, 129, 0.5);
    outline-offset: 2px;
}

/* Category selector styles */
.category-selector {
    position: relative;
    display: inline-block;
    width: 300px;
}

.selected-category {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    cursor: pointer;
    min-height: 34px;
    display: flex;
    align-items: center;
}

.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    background-color: white;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.category-selector:hover .category-dropdown,
.category-selector:focus-within .category-dropdown {
    display: block;
}

/* Article list styles */
.article-list {
    margin-top: 20px;
}

.category-section {
    border: 1px solid var(--outline);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--elevation-1);
}

.category-header {
    background: var(--surface);
    padding: 1rem;
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--outline);
    transition: background-color 0.2s ease;
}

.category-header:hover {
    background: var(--surface-hover);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.125rem;
    color: var(--on-surface);
}

.category-title .material-icons {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.category-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.category-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.category-toggle .material-icons {
    color: var(--on-surface);
    transition: transform 0.2s ease;
}

.category-content {
    padding: 1rem;
}

.article {
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    background-color: #fff;
}

.article-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1em;
}

.article-title {
    flex: 1;
    margin: 0;
    font-size: 1.1em;
}

.article-title a {
    color: #333;
    text-decoration: none;
}

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

.article-date {
    margin: 0 10px;
    color: #888;
    white-space: nowrap;
    font-size: 0.9em;
    font-style: italic;
}

.article-source {
    color: #888;
    white-space: nowrap;
    font-size: 0.9em;
}

.article-content {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Filter form styles */
.filter-form {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--elevation-1);
}

.compact-filter {
    background: var(--surface);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--elevation-1);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    min-height: 40px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 40px;
}

.filter-group > * {
    display: flex;
    align-items: center;
    height: 100%;
}

.compact-input {
    padding: 0.5rem;
    border: 1px solid var(--outline);
    border-radius: 4px;
    background: white;
    transition: border-color 0.2s ease;
    min-width: 120px;
    height: 100%;
    box-sizing: border-box;
}

.compact-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.compact-selector {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.compact-select {
    padding: 0.5rem;
    border: 1px solid var(--outline);
    border-radius: 4px;
    background: white;
    transition: border-color 0.2s ease;
    min-width: 120px;
    height: 100%;
    box-sizing: border-box;
}

.compact-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.compact-checkbox-label {
    font-size: 0.875rem;
    color: var(--on-surface);
    margin-right: 0.25rem;
    display: flex;
    align-items: center;
    height: 100%;
}

.compact-checkbox {
    margin: 0;
    height: 20px;
    width: 20px;
    display: flex;
    align-items: center;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    align-items: center;
    height: 40px;
}

.compact-btn {
    background-color: #28a745; /* Changed from primary color to a green shade */
    color: var(--on-primary);
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.compact-btn:hover {
    background-color: var(--primary-dark);
}

.compact-btn.refresh-btn {
    background-color: var(--secondary-color);
    color: var(--on-secondary);
}

.compact-btn.refresh-btn:hover {
    background-color: var(--secondary-dark);
}

/* Content list styles */
.content-item {
    border: 1px solid var(--outline);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
    background-color: var(--surface);
    box-shadow: var(--elevation-1);
    transition: box-shadow 0.2s ease;
}

.content-item:hover {
    box-shadow: var(--elevation-2);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--outline);
}

.content-title {
    margin: 0;
    font-size: 1.125rem;
    color: var(--on-surface);
}

.content-title a {
    color: var(--on-surface);
    text-decoration: none;
    transition: color 0.2s ease;
}

.content-title a:hover {
    color: var(--primary-color);
}

.content-date {
    font-size: 0.875rem;
    color: var(--light-text);
    font-style: italic;
}

.content-body {
    margin-top: 0.75rem;
}

.content-body p {
    margin: 0 0 0.75rem;
    color: var(--on-surface);
}

.content-preview {
    color: var(--on-surface);
}

.content-preview h1, h2, h3 {
    margin-top: 1rem;
    color: var(--on-surface);
}

.content-preview h1 {
    font-size: 1.125rem;
}

.content-preview h2 {
    font-size: 1.0625rem;
}

.content-preview h3 {
    font-size: 1rem;
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .category-selector {
        width: 100%;
    }

    .article-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-date,
    .article-source {
        margin-top: 5px;
    }

    .filter-form {
        padding: 10px;
    }

    .filter-form label {
        display: block;
        margin-bottom: 5px;
    }

    .filter-form select,
    .filter-form input {
        width: 100%;
        margin-right: 0;
    }

    .filter-form button {
        width: 100%;
        margin-top: 10px;
    }

    .content-item {
        padding: 1rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .content-date {
        font-size: 0.75rem;
    }
}

/* Accessibility features */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

[role="button"],
[role="tab"] {
    cursor: pointer;
}

[aria-hidden="true"] {
    display: none;
}

/* Content list styles */
.content-item {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #fff;
}

/* Rating widget styles */
.rating-widget {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.rating-stars {
    display: flex;
    gap: 4px;
}

.rating-stars .star {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ccc;
    transition: color var(--transition-speed);
}

.rating-stars .star.filled {
    color: #ffb400; /* Amber for filled stars */
}

/* Comment icon style */
.comment-section .comment-icon {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--on-surface);
    margin-left: 0.5rem;
}

.content-title {
    margin: 0;
    font-size: 1.2rem;
}

.content-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.content-preview {
    color: #333;
}

.content-preview h1, h2, h3 {
    margin-top: 14px;
}

.content-preview h1 {
    font-size: 1.2rem;
}

.content-preview h2 {
    font-size: 1.1rem;
}

.content-preview h3 {
    font-size: 1rem;
}

.content-list .content-date {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: 350px;
}

.toast {
    background: var(--primary-color) !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    color: var(--on-primary) !important;
    position: relative; /* Ensure it's positioned relative to the container */
    width: 100%; /* Make it full width of the container */
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

.toast-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.toast-message {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    margin-left: 8px;
}
}

.modal-body img {
    max-width: 100%;
    height: auto;
}

/* Touch screen adaptations */
.touch-screen {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */
    touch-action: pan-y; /* Allow vertical scrolling */
}

/* Touch-friendly scrollbars */
.touch-screen ::-webkit-scrollbar {
    width: 38px; /* Wider scrollbar for touch devices */
    height: 38px;
}

.touch-screen ::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.5); /* More visible scrollbar thumb */
    border-radius: 9px;
    border: 3px solid rgba(0, 0, 0, 0.1);
}

.touch-screen ::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.1); /* More visible scrollbar track */
    border-radius: 8px;
}

/* For Firefox */
body.touch-screen {
    overflow-y: scroll !important;
}
.touch-screen {
    scrollbar-width: 38px; /* Wider scrollbar for touch devices */
    scrollbar-color: rgba(255, 0, 0, 0.5) rgb(250, 0, 0); /* Scrollbar thumb and track colors */
    overflow-y: scroll; /* Always show vertical scrollbar */
    overflow-x: hidden; /* Hide horizontal scrollbar */
}
html.touch-screen {
    overflow-y: scroll!important; /* Ensure vertical scrollbar is always visible */
}
/* Temporarily apply touch styles to all devices for testing */
.touch-screen .btn,
.touch-screen .form-control,
.touch-screen .nav-link,
.touch-screen .category-header {
  min-height: 44px;
}

.touch-screen .btn,
.touch-screen .form-control,
.touch-screen .nav-link {
  margin: 0.5rem 0;
}

.touch-screen .btn,
.touch-screen .form-control,
.touch-screen .nav-link,
.touch-screen .category-header {
  min-width: 44px;
}

.touch-screen .btn {
  padding: 0.75rem 1.5rem;
  min-height: 48px;
}

.touch-screen .form-control {
  min-height: 44px;
  width: auto;
  max-width: 120px;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
}

.touch-screen .datepicker {
  width: 100px !important;
  max-width: 100px !important;
  min-width: 100px !important;
}

.touch-screen .card {
  padding: 1.5rem;
  margin: 1rem 0;
}

/* Original touch screen adaptations using media queries */
@media (pointer: coarse), (hover: none) {
  /* Touch-specific styles here */
  .btn {
    padding: 0.75rem 1.5rem;
    min-height: 48px;
  }

  .form-control {
    min-height: 44px;
  }

  .card {
    padding: 1.5rem;
    margin: 1rem 0;
  }

  /* Increase touch target sizes */
  .btn, .form-control, .nav-link, .category-header {
    min-height: 44px;
  }

  /* Increase spacing between touch targets */
  .btn, .form-control, .nav-link {
    margin: 0.5rem 0;
  }

  /* Ensure minimum touch target size */
  .btn, .form-control, .nav-link, .category-header {
    min-width: 44px;
  }
}
