* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 95%;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 10px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: bold;
    color: #11395c;
    margin: 0;
}

.description {
    margin-bottom: 15px;
    font-size: 17px;
    color: #666;
    line-height: 1.8;
    text-align: center;
}

.video-selector-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.video-selector {
    flex: 1;
    max-width: 45%;
}

.video-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.dropdown {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.video-comparison {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    width: 100%;
}

.video-container {
    flex: 1;
    position: relative;
}

.video-wrapper {
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    width: 100%;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    aspect-ratio: 16 / 9;
    background-color: black;
    display: block;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #333, #666);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    border-radius: 8px;
}

.video-overlay-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    height: 35px;
    width: auto;
    opacity: 0.8;
    z-index: 10;
    pointer-events: none;
}

.video-overlay-logo.logo-right {
    left: auto;
    right: 10px;
}

.file-input-container {
    margin: 10px 0;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#playToggleBtn {
  width: 120px;
}

.btn-primary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.btn-primary:hover {
    background-color: #e0e0e0;
}

.btn-info {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.btn-info:hover {
    background-color: #e0e0e0;
}

.btn-overlay {
    background-color: #5a9fd4;
    color: white;
}

.btn-overlay:hover {
    background-color: #4a8fc4;
}

#fileInfoDialog {
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    width: 80vw;
    max-width: 900px;
    position: relative; /* ÿÿ */
}

#fileInfoTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    table-layout: fixed;
}

#fileInfoTable th, #fileInfoTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    padding-top: 2px;
    padding-bottom: 2px;
    vertical-align: middle;
}

#fileInfoTable th {
    background-color: #f2f2f2;
}

#fileInfoTable th:first-child,
#fileInfoTable td:first-child {
    white-space: nowrap;
    width: 120px;
}

#fileInfoTable td:not(:first-child) {
    word-break: break-all;
}

.contact-section {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.contact-message {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.contact-info {
    font-size: 14px;
    color: #0066cc;
    line-height: 1.8;
}

.contact-info strong {
    color: #333;
}

@media (max-width: 768px) {
    .video-comparison {
        flex-direction: column;
    }
    .controls {
        flex-wrap: wrap;
    }
    .container {
        margin: 10px;
        padding: 15px;
    }
}

/* --- Overlay View --- */
#comparisonContainer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: black;
}

.overlay-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden; 
}
#rightWrapper {
    z-index: 1; 
}
#leftWrapper {
    z-index: 2; 
}
.overlay-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.overlay-wrapper .video-overlay-logo {
    z-index: 3; 
}

#slider-divider-horizontal, #slider-divider-vertical {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    z-index: 9999;
}
#slider-divider-horizontal {
    top: 0; left: 50%;
    width: 2px; height: 100%;
    transform: translateX(-50%);
}
#slider-divider-vertical {
    top: 50%; left: 0;
    width: 100%; height: 2px;
    transform: translateY(-50%);
}

#sliderControlHorizontal, #sliderControlVertical {
    position: absolute;
    z-index: 10000;
}
#sliderControlHorizontal {
    bottom: 60px; width: calc(100% - 100px); left: 50px;
}
#sliderControlVertical {
    right: 40px;
    top: 10%;
    width: calc(100vh - 200px);
    height: 100px;
    transform: translateY(-50%) rotate(270deg);
    transform-origin: 100% 50%;
}

#comparisonContainer #centerControls {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
#comparisonContainer.show-controls #centerControls {
    opacity: 1;
    pointer-events: auto;
}
.img-btn {
  width: 56px; height: 56px; border: 2px solid #ccc;
  background-color: rgba(204, 204, 204, 0.5); padding: 0;
  border-radius: 50%; cursor: pointer;
}
.img-btn:hover { background-color: rgba(204, 204, 204, 0.8); }
.img-btn img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: contain;
}

#closeOverlayBtn {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 28px;
  line-height: 38px;
  text-align: center;
  padding: 0;
  cursor: pointer;
  z-index: 10003;
  transition: background-color 0.2s;
}

#closeOverlayBtn:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

#closeDialogBtn {
  position: absolute;
  top: 10px;
  right: 15px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 0;
}

#closeDialogBtn:hover {
  color: #333;
}