/* News & Events Widget Styles */
.news-events-container {
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.news-events-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Main Heading */
.main-heading {
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 2.8em;
    text-align: center;
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

/* Day Filter */
.day-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.day-btn {
    padding: 10px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.day-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.day-btn.active {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    border-color: #ff6b35;
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
}

/* Layout with Sidebar - TRENDING ON RIGHT */
.content-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.content-layout.with-sidebar {
    /* Main content on LEFT, Sidebar on RIGHT */
}

.content-layout.no-sidebar {
    justify-content: center;
}

.content-layout.no-sidebar .sidebar-content {
    display: none;
}

/* Main Content Area - LEFT SIDE */
.main-content {
    flex: 2;
    min-width: 0;
}

.main-content .template-grid[data-columns="2"] .grid-items {
    grid-template-columns: repeat(2, 1fr);
}

.main-content .template-grid[data-columns="3"] .grid-items {
    grid-template-columns: repeat(3, 1fr);
}

/* Sidebar Styles - RIGHT SIDE */
.sidebar-content {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 15px;
    color: white;
    min-height: 600px;
    position: sticky;
    top: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 350px;
}

.sidebar-title {
    margin: 0 0 25px 0;
    color: white;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 15px;
}

.sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-item {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.sidebar-image {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-image img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-item:hover .sidebar-image img {
    transform: scale(1.05);
}

.sidebar-item-title {
    margin: 0 0 8px 0;
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
}

.sidebar-item-text {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    line-height: 1.4;
}

.no-sidebar-content {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255,255,255,0.7);
    font-style: italic;
}

/* Main Content Images */
.item-image {
    position: relative;
    margin-bottom: 20px;
    display: block;
    text-align: center;
}

.item-image img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.template-grid .grid-item:hover .item-image img {
    transform: scale(1.1) rotate(3deg);
    border-color: #ff6b35;
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.3);
}

/* Read More Button */
.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: rgba(255, 107, 53, 0.8);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    margin-top: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.read-more-btn:hover {
    background: rgba(255, 107, 53, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-layout {
        flex-direction: column;
    }
    
    .sidebar-content {
        position: static;
        min-height: auto;
        max-width: none;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .main-content .template-grid[data-columns="2"] .grid-items,
    .main-content .template-grid[data-columns="3"] .grid-items {
        grid-template-columns: 1fr;
    }
}

/* No Content Message */
.no-content {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    color: #6c757d;
    font-size: 16px;
}

/* Quick Add Panel */
.quick-add-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.quick-add-panel h3 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 18px;
}

.quick-add-form .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.quick-add-form input,
.quick-add-form select,
.quick-add-form textarea {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
}

.quick-add-form textarea {
    resize: vertical;
    min-height: 60px;
}

.add-btn {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.add-btn:hover {
    background: #218838;
}

.event-fields {
    display: none;
}

/* Management Panel */
.management-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.management-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.form-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.news-form, .events-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row input, .form-row select, .form-row textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

/* Image Upload Section */
.image-upload-section {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.image-upload-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.image-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.upload-btn {
    padding: 8px 15px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.image-preview {
    margin-top: 10px;
    max-height: 150px;
    overflow: hidden;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-primary {
    background: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Existing Items Management */
.existing-items {
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 20px;
}

.existing-items h3 {
    margin-bottom: 15px;
    color: #333;
}

.items-list {
    max-height: 400px;
    overflow-y: auto;
}

.item-row {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

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

.item-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

.item-info {
    flex: 1;
}

.item-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.item-meta {
    font-size: 12px;
    color: #666;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.edit-btn, .delete-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.edit-btn {
    background: #28a745;
    color: white;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

/* Content Display Templates */
.content-display {
    margin-top: 20px;
}

/* Template 1: Carousel + Sidebar */
.template-carousel-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.left-carousel {
    position: relative;
}

.carousel-container {
    overflow: hidden;
    border-radius: 10px;
}

.carousel-items {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-item {
    min-width: 100%;
    position: relative;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
}

.carousel-prev, .carousel-next {
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.right-sidebar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

/* Template 2: Grid Layout */
.template-grid .grid-items {
    display: grid;
    gap: 30px;
    position: relative;
    z-index: 2;
}

.template-grid .grid-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.template-grid .grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff6b35, #f7931e, #ff6b35);
    background-size: 200% 100%;
    animation: gradientMove 3s infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.template-grid .grid-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.template-grid[data-columns="1"] .grid-items { grid-template-columns: 1fr; }
.template-grid[data-columns="2"] .grid-items { grid-template-columns: repeat(2, 1fr); }
.template-grid[data-columns="3"] .grid-items { grid-template-columns: repeat(3, 1fr); }
.template-grid[data-columns="4"] .grid-items { grid-template-columns: repeat(4, 1fr); }
.template-grid[data-columns="6"] .grid-items { grid-template-columns: repeat(6, 1fr); }

/* Template 3: List + Sidebar */
.template-list-sidebar {
    display: grid;
    gap: 30px;
}

.template-list-sidebar[data-sidebar="left"] {
    grid-template-columns: 1fr 2fr;
}

.template-list-sidebar[data-sidebar="right"] {
    grid-template-columns: 2fr 1fr;
}

.template-list-sidebar[data-sidebar="none"] {
    grid-template-columns: 1fr;
}

/* News/Event Items */
.news-item, .event-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-item:hover, .event-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.item-image {
    position: relative;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

/* Image Hover Effects */
.image-hover-zoom .item-image:hover img {
    transform: scale(1.1);
}

.image-hover-zoom-out .item-image:hover img {
    transform: scale(0.9);
}

.image-hover-fade .item-image:hover img {
    opacity: 0.8;
}

.item-content {
    padding: 20px;
    text-align: center;
}

.item-title {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #ffffff;
}

.item-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.item-author, .item-date, .item-comments {
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.item-category {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
}

/* Pagination */
.pagination-container {
    margin-top: 30px;
    padding: 20px 0;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background: #f8f9fa;
}

.pagination-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.load-more-btn {
    background: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .template-carousel-sidebar,
    .template-list-sidebar {
        grid-template-columns: 1fr;
    }
    
    .template-grid[data-columns="3"] .grid-items,
    .template-grid[data-columns="4"] .grid-items,
    .template-grid[data-columns="6"] .grid-items {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .management-tabs {
        flex-direction: column;
    }
    
    .item-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .template-grid .grid-items {
        grid-template-columns: 1fr;
    }
    
    .news-events-container {
        padding: 10px;
    }
    
    .item-content {
        padding: 15px;
    }
    
    .pagination-wrapper {
        flex-wrap: wrap;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .news-events-container {
        background: #1a1a1a;
        color: #fff;
    }
    
    .news-item, .event-item {
        background: #2d2d2d;
        color: #fff;
    }
    
    .management-panel {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .form-row input, .form-row select, .form-row textarea {
        background: #3d3d3d;
        border-color: #555;
        color: #fff;
    }
}

/* Pagination Styles */
.pagination-container {
    margin-top: 30px;
    text-align: center;
    padding: 20px 0;
    display: block !important;
    visibility: visible !important;
}

.pagination-wrapper {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-btn:hover {
    background: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
    text-decoration: none;
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.3);
}

.pagination-btn.active:hover {
    background: #005a87;
    border-color: #005a87;
    transform: translateY(-1px);
}

.pagination-dots {
    padding: 8px 4px;
    color: #6c757d;
    font-weight: bold;
}

/* Auto-scroll indicator */
.auto-scroll-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 124, 186, 0.1);
    color: #007cba;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.auto-scroll-indicator.paused {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-wrapper {
        gap: 4px;
    }
    
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .pagination-container {
        margin-top: 20px;
        padding: 15px 0;
    }
}

@media (max-width: 480px) {
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .pagination-wrapper {
        gap: 2px;
    }
}

/* Additional text styling for radio schedule theme */
.item-excerpt {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.item-category {
    color: #ff6b35 !important;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 10px;
    display: inline-block;
}

.item-date {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.85em;
}

.item-author {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.85em;
}
