/**
 * School Notice Plugin - Frontend Styles
 * 
 * @package SchoolNoticePlugin
 * @author Kunal Bose
 * @version 1.1.0
 */

.school-notices-container {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
}

.school-notices-container::-webkit-scrollbar {
    width: 8px;
}

.school-notices-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.school-notices-container::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 4px;
}

.school-notices-container::-webkit-scrollbar-thumb:hover {
    background: #005a87;
}

.school-notice-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    margin: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.school-notice-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--notice-color, #0073aa);
}

.school-notice-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.notice-title {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid var(--notice-color, #0073aa);
    padding-bottom: 8px;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 10px 15px;
    border-radius: 8px;
    margin: -10px -15px 15px -15px;
}

.notice-title::after {
    content: '';
    display: none;
}

.notice-content {
    color: #34495e;
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 15px;
    background: rgba(255,255,255,0.7);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--notice-color, #0073aa);
}

.notice-date {
    color: white;
    font-size: 13px;
    font-style: italic;
    background: var(--notice-color, #0073aa);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Modern style */
.school-notices-container.style-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.school-notices-container.style-modern .school-notice-item {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.school-notices-container.style-modern .notice-title {
    color: #2c3e50;
    border-bottom-color: #667eea;
}

.school-notices-container.style-modern .notice-content {
    color: #34495e;
}

.school-notices-container.style-modern .notice-date {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Card style */
.school-notices-container.style-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.school-notices-container.style-card .school-notice-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.school-notices-container.style-card .school-notice-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.school-notices-container.style-card .notice-title {
    color: #495057;
    border-bottom-color: #6c757d;
}

.school-notices-container.style-card .notice-content {
    color: #6c757d;
}

.school-notices-container.style-card .notice-date {
    background: #e9ecef;
    color: #6c757d;
}

/* Auto-scroll container - Slider Style */
.school-notices-container.auto-scroll {
    overflow: hidden;
    position: relative;
    scroll-behavior: smooth;
}

.school-notices-container.auto-scroll:hover {
    scroll-behavior: auto;
}

/* Create seamless loop by duplicating content */
.school-notices-container.auto-scroll .school-notices-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}

/* Hide scrollbars for slider effect */
.school-notices-container.auto-scroll {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.school-notices-container.auto-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Slider animation keyframes */
@keyframes slideUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

@keyframes slideDown {
    0% { transform: translateY(-50%); }
    100% { transform: translateY(0); }
}

.school-notices-container.auto-scroll.slider-mode .school-notices-wrapper {
    animation: slideUp 20s linear infinite;
}

.school-notices-container.auto-scroll.slider-mode.slider-down .school-notices-wrapper {
    animation: slideDown 20s linear infinite;
}

/* Ensure proper height for seamless loop */
.school-notices-container.auto-scroll.slider-mode .school-notices-wrapper {
    height: 200%; /* Double height for seamless loop */
}

.school-notices-container.auto-scroll.slider-mode:hover .school-notices-wrapper {
    animation-play-state: paused;
}

/* Slider speed controls */
.school-notices-container.auto-scroll.slider-mode.slow .school-notices-wrapper {
    animation-duration: 30s;
}

.school-notices-container.auto-scroll.slider-mode.fast .school-notices-wrapper {
    animation-duration: 10s;
}

/* Smooth scrolling for non-auto-scroll */
.school-notices-container:not(.auto-scroll) {
    scroll-behavior: smooth;
}

/* Auto-scroll speed control */
.school-notices-container.auto-scroll.slow {
    animation-duration: 45s;
}

.school-notices-container.auto-scroll.fast {
    animation-duration: 15s;
}

/* Read More functionality */
.read-more-link {
    color: var(--notice-color, #0073aa);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
}

.read-more-link:hover {
    text-decoration: underline;
}

.read-more-content {
    color: inherit;
    display: block;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 115, 170, 0.2);
}

.read-more-content a {
    color: var(--notice-color, #0073aa);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
}

.read-more-content a:hover {
    text-decoration: underline;
}

.show-less-link {
    color: var(--notice-color, #0073aa);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
}

.show-less-link:hover {
    text-decoration: underline;
}


/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .school-notices-container.auto-scroll.slider-mode .school-notices-wrapper {
        animation: none !important;
    }
    
    .school-notice-item {
        animation: none !important;
        transition: none !important;
    }
    
    .school-notice-item:hover {
        transform: none !important;
    }
}

/* Focus styles for keyboard navigation */
.read-more-link:focus,
.show-less-link:focus {
    outline: 2px solid var(--notice-color, #0073aa);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Responsive design */
@media (max-width: 768px) {
    .school-notices-container {
        max-height: 300px;
        margin: 10px 0;
    }
    
    .school-notice-item {
        padding: 15px;
        margin: 10px;
    }
    
    .notice-title {
        font-size: 18px;
    }
    
    .notice-content {
        font-size: 14px;
    }
}

