/* 1. Basic Reset & Typography */
body {
    font-family: Calibri, sans-serif;
    background-color: #ffffff;
    color: #333;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 2. Layout Containers */
.main-container {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* 3. Header & Navigation */
.top-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 0;
    margin-bottom: 5px;
}

.header-spacer {
    width: 140px; 
}

.title-group {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

h1 {
    font-size: 2.5rem;
    color: #4b6382;
    margin: 0;
    text-transform: uppercase;
}

.return-to-main-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: #4b6382;
    color: white;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    font-size: 16px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.return-to-main-menu-btn:hover {
    background-color: #3a4d65;
    transform: translateY(-2px);
}

.version-btn {
    background-color: #cdd5d8;
    color: #4b6382;
    border: none;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.version-btn:hover {
    background-color: #4b6382;
    color: white;
    transform: translateY(-1px);
}

/* 4. Search Bar */
.search-container {
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

.search-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 600px;
}

#searchInput {
    width: 100%;
    padding: 12px 40px 12px 15px;
    font-size: 18px;
    border: 2px solid #cdd5d8;
    border-radius: 12px;
    color: #4b6382;
    outline: none;
    box-shadow: 2px 2px 5px #a4b5c4;
}

#clearSearch {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: none;
    align-items: center;
}

/* 5. Table Layout */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 2px 2px 5px #a4b5c4;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Essential for fixed column widths */
    background-color: #ffffff;
}

/* Column Widths */
th:nth-child(1) { width: 50px; }  /* # */
th:nth-child(2) { width: 10%; }   /* İngilizce */
th:nth-child(3) { width: 10%; }   /* Türkçe */
th:nth-child(4) { width: 45%; }   /* Açıklama */
th:nth-child(5) { width: 15%; }   /* Resim */
th:nth-child(6) { width: 15%; }   /* Video */

thead {
    background-color: #4b6382;
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border: 2px solid #4b6382;
    word-wrap: break-word;
    vertical-align: middle;
}

/* 6. STRICT HEIGHT CONTROL (Vertical Adjustment) */

/* Lock the Row Height */
tbody tr {
    height: 164px; 
    max-height: 164px;
}

/* Update this block to ensure all rows hover correctly */
tbody tr:hover {
    background-color: #cdd5d8 !important; /* Force hover color on every row */
    cursor: default;
}

/* Maintain zebra striping for non-hover state */
tbody tr:nth-child(even) {
    background-color: #f9fbfc;
}

/* Lock the Image/Video Cells */
td:nth-child(5), td:nth-child(6) {
    width: 300px; /* Force width */
    height: 164px; /* Force height */
    padding: 0 !important; /* Remove padding */
    line-height: 0; /* Remove line height spacing */
    overflow: visible; /* Allow hover zoom to POP OUT */
    position: relative; /* Context for absolute positioning if needed */
    background-color: #f0f3f5;
}

/* 7. THUMBNAIL STYLING */

/* Force images to fit the box strictly */
.thumbnail-img {
    display: block;
    width: 100%;
    height: 100%; /* Fills the 164px cell height exactly */
    object-fit: contain; /* Ensures tall images don't stretch */
    object-position: center; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white; /* Clean background for transparent PNGs */
}

/* Thumbnail Hover Effect (Zoom) */
.thumbnail-img:hover {
    transform: scale(1.1); /* Zooms image 30% larger */
    z-index: 999; /* Brings it to the front */
    position: relative; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.3); /* Adds a "pop up" shadow */
    border-radius: 4px;
}

/* Video specific styling */
.video-container {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: visible; /* Changed from hidden to allow pop-out zoom */
    text-decoration: none;
}

.video-thumb {
    border: 2px solid #4b6382;
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Video Hover effect to match regular thumbnails */
.video-container:hover .video-thumb {
    transform: scale(1.1);
    z-index: 999;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-radius: 4px;
}

/* Ensure play button stays centered during zoom */
.video-container:hover .play-overlay {
    z-index: 1000;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Hover for Video Wrapper */
.video-container:hover .video-thumb {
    transform: scale(1.1);
    
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(75, 99, 130, 0.8);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    pointer-events: none;
}

/* 8. Utility Classes & Modal */
.highlight {
    background-color: #fff176;
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 50%;
    border-radius: 12px;
    font-family: Calibri, sans-serif;
}

/* 9. Mobile Adjustments */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    .header-spacer { display: none; }
    .top-header-container { flex-direction: column; gap: 10px; }
    table { min-width: 800px; }
}