

* {
    box-sizing: border-box;
}

body {
    font-family: "Sarabun", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg,#00685f 0%,#38a199 40%,#e9ebef 100%);
    color: #2e4d3a;
    
 
    overflow-x: hidden; 
    width: 100%;
}


header {
    background-color: #267c75; 
    color: white;
    padding: 20px;
    min-height: 220px;      
    
  
    display: flex;
    flex-direction: row;        
    align-items: center;      
    justify-content: center;  
    gap: 40px;                 
}



.event-section {
    width: 340px;             
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 10px;
    color: #2e4d3a;
    flex-shrink: 0;           
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


.header-text {
    text-align: left;      
    max-width: 600px;

}

.header-text h1 {
    font-size: 42px;           
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.header-text p {
    font-size: 20px;
    margin: 0;
    opacity: 0.9;
}


.mobile-cal-btn { display: none; }


@media (max-width: 1024px) {
    header {
        padding: 15px;
        gap: 20px;           
        justify-content: center; 
    }

    .event-section { width: 300px; } 
    .header-text h1 { font-size: 32px; }
    .header-text p { font-size: 16px; }
}


@media (max-width: 650px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 30px 15px;
        gap: 15px;
    }

   
    .event-section { display: none !important; }

  
    .mobile-cal-btn {
        display: inline-block;
        margin-top: 5px;
        background: #ffffff;
        color: #00685f;
        border: none;
        padding: 10px 24px;
        border-radius: 30px;
        font-weight: bold;
        font-size: 16px;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

  
    .header-text {
        text-align: center;
        width: 100%;
    }

    .header-text h1 { font-size: 26px; }
    .header-text p { font-size: 14px; display: block; }
}

nav {
    background-color: #347670;
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 10px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 40px 20px;
}

.category {
    margin-bottom: 60px;
}

.category h2 {
    background-color: #c8e6c9;
    padding: 12px 15px;
    border-left: 8px solid #23968c;
    color: #52827e;
}

.videos {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
    margin-top: 20px;
}

.video-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

iframe {
    width: 100%;
    height: 180px;
    border-radius: 10px;
}

@media (max-width:1024px){
    .videos{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:600px){
    .videos{grid-template-columns:1fr;}

    iframe{height:200px;}
}

.search-box {
    background-color: #c8e6c9;
    padding: 25px;
    text-align: center;
}

.search-wrapper{
    display:flex;
    justify-content:center;
    max-width:700px;
    margin:auto;
}

.search-wrapper input{
    flex:1;
    padding:12px 15px;
    font-size:16px;
    border-radius:30px 0 0 30px;
    border:2px solid #00685f;
    outline:none;
}

.search-wrapper button{
    padding:12px 18px;
    border:2px solid #00685f;
    border-left:none;
    cursor:pointer;
    background:#00685f;
    color:white;
    border-radius: 0 30px 30px 0; 
}

.suggestions{
    list-style:none;
    padding:0;
    margin:8px auto 0;
    max-width:700px;
    background:white;
    border-radius:10px;
    box-shadow:0 4px 10px rgba(0,0,0,.15);
    display:none;
    text-align:left;
}

.suggestions li{
    padding:10px 15px;
    cursor:pointer;
}

.suggestions li:hover{
    background:#e8f5e9;
}

.result-count{
    margin-top:10px;
    font-weight:bold;
    color:#1b5e20;
}

.no-result{
    display:none;
    margin-top:30px;
    font-size:20px;
    font-weight:bold;
    color:#b71c1c;
    text-align:center;
}

footer{
    background:#00685f;
    color:white;
    text-align:center;
    padding:15px;
}


.calendar-icon {
    position: fixed;
    top: 70px;
    left: 15px;
    background-color: #2e7d32;
    color: white;
    font-size: 20px;
    padding: 10px 14px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    z-index: 1000;
}

.calendar-icon:hover {
    background-color: #1b5e20;
}


.calendar-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.calendar-content {
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    margin: 80px auto;
    padding: 25px;
    border-radius: 16px;
    position: relative;
    animation: zoomIn 0.3s ease;
}


@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 26px;
    cursor: pointer;
    color: #2e7d32;
}


.calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.calendar-table th,
.calendar-table td {
    border: 1px solid #c8e6c9;
    padding: 14px;
    text-align: left;
}

.calendar-table th {
    background-color: #c8e6c9;
    color: #76b3ae;
}

.section-title {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
}

.section-title span {
  margin-left: 8px;
}

.event-card{
    background: #ffffff;
    border: 1.5px solid #79b8b3;
    border-radius: 8px;    
    padding: 8px 10px;      
    margin-bottom: 8px;      
    font-size: 12px;       
}
.event-section{
    width: 240px;
    max-height: 350px;
}

.event-header {
  display: flex;
  align-items: center;
  font-weight: bold;
  margin-bottom: 6px;
}

.event-header .icon {
  font-size: 14px;
  margin-right: 3px;
}

.event-info {
  font-size: 12px;
  line-height: 1.6;
  color: #333;
}

.event-info div {
  display: flex;
  align-items: center;
}

.event-info span {
  margin-left: 4px;
}

.view-all {
  text-align: center;
  margin-top: 10px;
}

.view-all a {
  display: inline-block;
  padding: 8px 16px;
  background: #79b8b3;
  color: #ffffff;
  text-decoration: none;
  border-radius: 20px;
  font-size: 14px;
}

.video-wrapper{
    position: relative;
}

.add-event-btn{
    background:#2e7d32;
    color:white;
    border:none;
    padding:10px 18px;
    border-radius:25px;
    cursor:pointer;
    font-size:15px;
}

#eventForm input{
    width:100%;
    padding:10px;
    margin-top:8px;
    border-radius:8px;
    border:1px solid #c8e6c9;
}

#eventList{
    list-style:none;
    padding:0;
}

#eventList li{
    background:#f1f8f4;
    padding:12px;
    border-radius:10px;
    margin-bottom:10px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.event-actions button{
    margin-left:6px;
    cursor:pointer;
}

.more-btn{
  margin-left:10px;
  background:#2e7d32;
  color:white;
  border:none;
  padding:5px 12px;
  border-radius:20px;
  cursor:pointer;
  font-size:13px;
}
.more-btn:hover{
  background:#1b5e20;
}
.header-text h1{
    font-size: 48px;  
    margin-bottom: 12px;
}

.header-text p{
    font-size: 22px;    
    line-height: 1.6;
}


#upcomingEventList{
  max-height: 260px;    
  overflow-y: auto;
  padding-right: 6px;     
}


#upcomingEventList::-webkit-scrollbar{
  width: 6px;
}

#upcomingEventList::-webkit-scrollbar-thumb{
  background: #79b8b3;
  border-radius: 10px;
}

#upcomingEventList::-webkit-scrollbar-track{
  background: #e9f5f4;
}

#loginModal button{
    background: #97b6b3;    
    color: rgb(6, 8, 8);
    border: none;
    padding: 12px 20px;
    border-radius: 50px;      
    font-size: 16px;
    cursor: pointer;
    width: 40%;           
    margin-top: 15px;
    transition: all .25s ease;
}


#loginModal button:hover{
    background: #4e9f95;     
    transform: translateY(-2px);
}

#adminBar{
    text-align: right;
    padding: 12px 20px;
}


#adminBar button{
    background: #ffffff;
    color: #0c0e0e;
    border: 2px solid #00685f;
    padding: 8px 16px;
    border-radius: 25px;  
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 8px;
    transition: all .25s ease;
}


#adminBar button:hover{
    background: #00685f;
    color: #101011;
    transform: translateY(-2px);
}

#loginModal .calendar-content{
    display: flex;
    flex-direction: column;
    align-items: center; 
}
#loginModal input{
    width: 70%;          
    max-width: 320px;  
    padding: 12px;
    margin: 8px 0;
    border-radius: 10px;
    font-size: 15px;
}
#loginModal button{
    width: 70%;
    max-width: 320px;
}
#loginModal h2{
    text-align: center;
}



#loginModal button,
#passModal button{
    width: 70%;       
    max-width: 320px;
    padding: 12px;
    margin-top: 15px;
    border-radius: 10px;
    border: 1px solid #00685f;
    font-size: 16px;
    color:  #050808;
    cursor: pointer;
}
#passModal button:hover{
    background: #4e9f95;    
    transform: translateY(-2px);
}

#oldPass::placeholder,
#newPass::placeholder{
    color: #153842;      
    opacity: 1;       
}

.calendar-table-wrapper{
    max-height: 180px;     
    overflow-y: auto;
    margin-top: 10px;
}


.calendar-table-wrapper::-webkit-scrollbar{
    width: 6px;
}
.calendar-table-wrapper::-webkit-scrollbar-thumb{
    background: #79b8b3;
    border-radius: 10px;
}
.calendar-table-wrapper::-webkit-scrollbar-track{
    background: #e9f5f4;
}

.videos {
    display: flex;
    gap: 20px;
    overflow-x: auto;      
    scroll-behavior: smooth;
    padding: 10px 5px 25px;
    width: 100%;
    
    

    scrollbar-width: thin; 
    scrollbar-color: #2e7d32 #e8f5e9;
}


.videos::-webkit-scrollbar {
    height: 10px; 
}
.videos::-webkit-scrollbar-track {
    background: #e8f5e9; 
    border-radius: 10px;
}
.videos::-webkit-scrollbar-thumb {
    background: #2e7d32;
    border-radius: 10px;
    border: 2px solid #e8f5e9; 
}
.videos::-webkit-scrollbar-thumb:hover {
    background: #1b5e20; 
}


.video-card {
    min-width: calc(25% - 15px);
    width: calc(25% - 15px);
    flex-shrink: 0;
    
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}


iframe {
    width: 100%; height: 180px;
    border-radius: 8px; border: none;
    margin-bottom: 10px; flex-shrink: 0;
}


.mini-player-btn {
    position: absolute; 
    top: 10px; 
    right: 10px;
    background: rgba(255, 255, 255, 0.8); 
    border: none; 
    border-radius: 4px;
    cursor: pointer; 
    padding: 4px; 
    display: flex; 
    z-index: 10;
}


.video-card.floating .mini-player-btn {
    display: none !important;
}


.player-controls {
    position: absolute;
    top: 0; left: 0; width: 100%;
    display: none;
    justify-content: space-between;
    padding: 10px; 
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}


.video-card.floating .player-controls {
    display: flex;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card.floating:hover .player-controls {
    opacity: 1;
}

.control-btn {
    background: none; border: none; color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}


.video-card.floating {
    position: fixed !important; 
    bottom: 20px; 
    right: 20px;
    width: 320px !important; 
    z-index: 9999;
    border: 3px solid #2e7d32; 
    padding: 10px;
    background: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
} 


@media (max-width: 1024px) {
    .video-card { min-width: calc(50% - 10px); width: calc(50% - 10px); }
}


@media (max-width: 600px) {
    .video-card { 
        min-width: 70vw !important; 
        width: 70vw !important;
        padding: 10px;
    }
    
    .videos { 
        gap: 15px; 
        padding-left: 15px; padding-right: 20px;
       
        scrollbar-width: none; 
        padding-bottom: 10px;
    }
    .videos::-webkit-scrollbar { display: none; }
} 

.category.hidden-category {
    display: none;
}

.load-more-container {
    text-align: center;
    margin: 40px 0;
} 

.load-more-btn {
    background-color: #2e7d32;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: 0.3s;
}

.load-more-btn:hover {
    background-color: #1b5e20;
    transform: scale(1.05);
} 

.reaction-wrapper { position: relative; display: inline-block; margin: 10px 0; }
.main-like-btn { 
    background: #f8f9fa; border: 1px solid #eee; padding: 6px 15px; 
    border-radius: 20px; cursor: pointer; color: #666; font-size: 13px; 
    display: flex; align-items: center; gap: 5px; 
}
.main-like-btn.active { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }

.emoji-tray {
    position: absolute; bottom: 100%; left: 0; background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15); display: flex; gap: 5px;
    padding: 5px 10px; border-radius: 30px; opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 100; margin-bottom: 5px;
}
.reaction-wrapper:hover .emoji-tray { opacity: 1; visibility: visible; transform: translateY(0); }
.emoji-btn { background: none; border: none; font-size: 24px; cursor: pointer; transition: transform 0.2s; }
.emoji-btn:hover { transform: scale(1.3); }



.heart-pop { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); font-size: 60px; pointer-events: none; z-index: 10; opacity: 0; }
.heart-pop.animate { animation: heartPopEffect 0.8s ease-out; }
@keyframes heartPopEffect {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
} 

.badge-trending {
    position: absolute;
    top: 10px;
    right: 10px; 
    background: linear-gradient(45deg, #ff9800, #ff5722);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    z-index: 25;
    box-shadow: 0 4px 10px rgba(255, 87, 34, 0.4);
    animation: trendingFlash 1s infinite alternate;
}

@keyframes trendingFlash {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.05); }
}


.category-header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    background-color: #c8e6c9;
    padding: 12px 15px;
    border-left: 8px solid #2e7d32;
    margin-bottom: 15px;
}

.category-header h2 {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #1b5e20;
}


.view-all-btn {
    background: none;
    border: none;
    color: #1b5e20;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}


.full-page-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: #f5f5f5; z-index: 3000;
    transform: translateX(100%); 
    transition: transform 0.3s ease-in-out;
    display: flex; flex-direction: column;
}
.full-page-overlay.active { transform: translateX(0); }

.overlay-header {
    background: white; padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex; align-items: center; gap: 15px;
}
.overlay-header h2 { margin: 0; font-size: 18px; color: #1b5e20; }
.back-btn { background: none; border: none; font-size: 16px; cursor: pointer; display: flex; align-items: center; }

.overlay-grid {
    padding: 20px; overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.overlay-grid .video-card { min-width: auto !important; width: 100% !important; margin: 0; } 


.search-container-google {
    padding: 30px 20px;
    background: #c8e6c9;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.google-search-wrapper {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-bar-inner {
    display: flex;
    align-items: center;
    padding: 6px 15px;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    transition: box-shadow 0.2s;
}

.search-bar-inner:hover, .search-bar-inner:focus-within {
    box-shadow: 0 1px 6px rgba(32,33,36,0.28);
    border-color: rgba(223,225,229,0);
}

.search-icon-left { color: #9aa0a6; margin-right: 12px; }

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    height: 35px;
    background: transparent;
}

.search-divider {
    width: 1px;
    height: 25px;
    background-color: #dfe1e5;
    margin: 0 10px;
}

.search-btn-trigger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.search-stats-text {
    margin-top: 12px;
    font-size: 14px;
    color: #70757a;
    width: 100%;
    max-width: 600px;
}


.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 6px rgba(32,33,36,0.1);
    border: 1px solid #dfe1e5;
    border-top: none;
    margin-top: -10px;
    padding: 15px 0 10px 0;
    z-index: 1000;
    display: none;
    list-style: none;
}

.suggestions-list li {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
}

.suggestions-list li:hover { background-color: #f1f3f4; }

.suggestions-list li::before {
    content: 'history';
    font-family: 'Material Symbols Outlined';
    margin-right: 15px;
    color: #9aa0a6;
    font-size: 20px;
}
.admin-only{
display:none;
}
.video-admin{
margin-top:10px;
display:flex;
gap:8px;
}

.video-admin button{
padding:5px 10px;
border:none;
border-radius:6px;
cursor:pointer;
}
