/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding-top: 0;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #ff9933 0%, #138808 50%, #000080 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-container {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.tagline {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.95;
    font-style: italic;
    margin: 0;
    padding-left: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(220, 38, 38, 1);
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 0;
}

.login-box {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
}

.login-title {
    text-align: center;
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 2rem;
}

.login-form {
    margin-bottom: 1rem;
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

/* Category Menu */
.category-menu {
    background: #2d3748;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 73px;
    z-index: 99;
}

.category-nav {
    display: flex;
    gap: 0;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.category-nav::-webkit-scrollbar {
    height: 4px;
}

.category-nav::-webkit-scrollbar-track {
    background: #1a202c;
}

.category-nav::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.category-link {
    color: white;
    text-decoration: none;
    padding: 0.7rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
}

.category-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: #667eea;
}

.category-link.active {
    background-color: rgba(102, 126, 234, 0.2);
    border-bottom-color: #667eea;
    color: #a5b4fc;
}

/* Category Badges */
.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-badge-large {
    font-size: 0.9rem;
    padding: 0.5rem 1.2rem;
    margin-bottom: 1rem;
}

.category-badge-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 300px);
}

/* Section Styles */
.admin-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.news-section {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #2d3748;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

/* Form Styles */
.news-form {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
}

.formatting-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    padding: 8px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
}

.format-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.format-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.format-btn strong,
.format-btn em,
.format-btn u {
    font-size: 14px;
    font-weight: bold;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

.image-preview {
    margin-top: 1rem;
    display: none;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-secondary {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.news-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Message Styles */
.message {
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
    display: none;
}

.message-success {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message-error {
    background-color: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

/* News Grid Styles */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.news-grid-public {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.news-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.news-card-public {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.news-card-public:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-image-container {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.news-image-public {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card-public:hover .news-image-public {
    transform: scale(1.05);
}

.news-content {
    padding: 1rem;
}

.news-content-public {
    padding: 1.5rem;
}

.news-heading {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.news-description {
    font-size: 0.95rem;
    color: #4a5568;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-heading-public {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #2d3748;
    line-height: 1.4;
}

.news-text-public {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1rem;
    text-align: justify;
}

.news-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
}

.news-views-public {
    color: #3b82f6;
    font-size: 0.85rem;
    font-weight: 500;
}

.news-card-public:hover .read-more {
    text-decoration: underline;
}

/* News Detail Page Styles */
.news-detail-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.news-detail-article {
    max-width: 900px;
    margin: 0 auto;
}

.news-detail-title {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 1rem;
    line-height: 1.3;
    border-bottom: 3px solid #667eea;
    padding-bottom: 1rem;
}

.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.news-detail-date {
    font-size: 1rem;
    color: #718096;
    font-weight: 500;
}

.news-detail-author {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 500;
}

.news-detail-views {
    font-size: 1rem;
    color: #3b82f6;
    font-weight: 500;
}

.news-detail-image-wrapper {
    margin: 2rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7fafc;
}

.news-detail-image {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    display: block;
}

.news-detail-content {
    margin-top: 2rem;
}

.news-detail-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #2d3748;
    text-align: justify;
    margin-bottom: 1.5rem;
}

.news-detail-text b,
.news-detail-text strong {
    font-weight: 700;
    color: #1a202c;
}

.news-detail-text i,
.news-detail-text em {
    font-style: italic;
}

.news-detail-text u {
    text-decoration: underline;
}

.news-detail-text b i,
.news-detail-text i b {
    font-weight: 700;
    font-style: italic;
}

.no-content {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.share-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.share-title {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 1rem;
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.share-btn:active {
    transform: translateY(-1px) scale(1.05);
}

.share-btn:active {
    transform: translateY(0);
}

.share-icon {
    font-size: 1.3rem;
}

.pdf-btn {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.pdf-btn:hover {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
}

.facebook-btn {
    background: linear-gradient(135deg, #1877F2 0%, #0C63D4 100%);
}

.facebook-btn:hover {
    background: linear-gradient(135deg, #0C63D4 0%, #0952B8 100%);
}

.twitter-btn {
    background: linear-gradient(135deg, #1DA1F2 0%, #0d8bd9 100%);
}

.twitter-btn:hover {
    background: linear-gradient(135deg, #0d8bd9 0%, #0a7bc2 100%);
}

.copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.back-button-container {
    text-align: center;
    margin: 2rem 0;
}

.back-button-container .btn {
    display: inline-block;
    text-decoration: none;
}

.news-date {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 1rem;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.news-date-public {
    font-size: 0.9rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Loading and No News */
.loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #718096;
}

.no-news {
    text-align: center;
    padding: 2rem;
    color: #718096;
    font-style: italic;
}

.no-news-public {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.no-news-public h3 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.no-news-public p {
    color: #718096;
}

.error-message {
    text-align: center;
    padding: 2rem;
    background: #fed7d7;
    border-radius: 10px;
    color: #742a2a;
}

/* Footer Styles */
.footer {
    background: #2d3748;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer-tagline {
    margin-top: 0.5rem;
    font-style: italic;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.75rem;
        padding-left: 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .news-grid,
    .news-grid-public {
        grid-template-columns: 1fr;
    }

    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .logo-container {
        text-align: center;
    }

    .tagline {
        padding-left: 0;
    }

    nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        flex: 0 1 auto;
    }
    
    .btn-logout {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .category-menu {
        top: auto;
        position: relative;
    }

    .category-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    main.container {
        padding-top: 1rem;
    }

    .news-detail-title {
        font-size: 1.8rem;
    }

    .news-detail-text {
        font-size: 1rem;
    }

    .news-detail-container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }
    
    .tagline {
        font-size: 0.65rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .news-heading-public {
        font-size: 1.2rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .btn-logout {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .category-menu {
        top: auto;
        position: relative;
    }
    
    .category-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .share-title {
        font-size: 1.1rem;
        text-align: center;
    }
}
/* Photo Gallery Styles */
.news-detail-gallery {
    margin: 2rem 0;
}

.main-photo-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.photo-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.photo-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

.photo-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.photo-thumbnails::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

.photo-thumbnails::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.photo-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.thumbnail:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.photo-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1;
}
/* Print Styles for PDF Export */
@media print {
    .header,
    .category-menu,
    .share-section,
    .back-button-container,
    .photo-thumbnails,
    .photo-counter {
        display: none !important;
    }
    
    body {
        background: white;
        margin: 0;
        padding: 20mm;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .news-detail-article {
        background: white;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    
    .news-detail-article::before {
        content: "📰 जनता का संदेश\Aसत्य की आवाज़, जनता का विश्वास";
        display: block;
        text-align: center;
        background: #1a202c;
        color: white;
        padding: 20px;
        margin: -20mm -20mm 20px -20mm;
        font-size: 24px;
        font-weight: bold;
        white-space: pre-line;
        page-break-after: avoid;
    }
    
    .news-detail-title {
        color: #000;
        page-break-after: avoid;
    }
    
    .news-detail-meta {
        border-bottom: 1px solid #ddd;
        page-break-after: avoid;
    }
    
    .news-detail-gallery,
    .main-photo-container img {
        max-width: 100%;
        height: auto;
        page-break-inside: avoid;
    }
    
    .news-detail-text {
        color: #000;
        font-size: 12pt;
        line-height: 1.6;
    }
}

/* Loading Indicator for Infinite Scroll */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: #718096;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-indicator p {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Skeleton Loader */
.skeleton-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-card::before {
    content: '';
    display: block;
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-card::after {
    content: '';
    display: block;
    padding: 1.5rem;
    background: white;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
