/**
 * Public styles for Video Translation Plugin
 */

/* Container styles */
.vtp-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Step styles */
.vtp-step {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.vtp-step h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

/* Aspect ratio display styling */
.vtp-aspect-ratio-display {
    font-size: 16px;
    font-weight: normal;
    color: #666;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

/* Upload area styles */
.vtp-upload-container {
    margin-bottom: 30px;
}

.vtp-upload-area {
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #f9f9f9;
}

.vtp-upload-area:hover,
.vtp-upload-area.highlight {
    border-color: #007cba;
    background-color: #f0f7fb;
}

/* Error message styles */
.vtp-error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin-bottom: 25px;
}

.vtp-error-message p {
    margin-top: 0;
    margin-bottom: 15px;
}

.vtp-error-message ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.vtp-error-message li {
    margin-bottom: 5px;
}

.vtp-upload-icon {
    font-size: 48px;
    color: #007cba;
    margin-bottom: 15px;
}

.vtp-upload-area p {
    margin: 10px 0;
    color: #555;
}

.vtp-upload-button {
    display: inline-block;
    background-color: #007cba;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin: 10px 0;
    transition: background-color 0.3s ease;
}

.vtp-upload-button:hover {
    background-color: #005a87;
}

.vtp-file-info {
    margin-top: 15px;
    font-weight: bold;
    color: #333;
}

/* Options container styles */
.vtp-options-container {
    margin-bottom: 30px;
}

.vtp-option-group {
    margin-bottom: 20px;
}

.vtp-option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.vtp-option-group select {
    width: auto;
    min-width: 200px;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
}

/* Inline form layout */
.vtp-option-group.vtp-inline-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: relative;
}

.vtp-language-container {
    flex: 0 0 auto;
}

.vtp-mode-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.vtp-mode-container label {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 0;
}

.vtp-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.vtp-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.vtp-radio-label input[type="radio"] {
    margin-right: 8px;
}

/* Instructions and button container styles */
.vtp-instructions-and-button-container {
    display: flex;
    align-items: stretch;
    gap: 30px;
    margin-bottom: 30px;
}

/* Instructions container styles */
.vtp-instructions-container {
    flex: 0 0 60%;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 20px;
}

.vtp-instructions-container h3 {
    margin-top: 0;
    color: #333;
}

.vtp-instruction-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.vtp-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
}

.vtp-x-icon {
    background-color: #ff5252;
    color: white;
    position: relative;
}

.vtp-x-icon:before {
    content: '×';
    font-size: 16px;
    font-weight: bold;
}

.vtp-check-icon {
    background-color: #4caf50;
    color: white;
    position: relative;
}

.vtp-check-icon:before {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
}

.vtp-instruction-text {
    color: #ff5252;
    font-weight: bold;
}

.vtp-instruction-item.completed .vtp-instruction-text {
    color: #4caf50;
}

/* Button styles */
.vtp-button-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vtp-button {
    background-color: #007cba;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.vtp-button:hover {
    background-color: #005a87;
}

.vtp-button-disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.vtp-button-disabled:hover {
    background-color: #cccccc;
}

/* Progress bar styles */
.vtp-progress-container {
    margin: 30px 0;
    position: relative;
    height: 20px; /* Fixed height container */
}

.vtp-progress-bar-wrapper {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.vtp-progress-bar {
    height: 100%;
    background-color: #007cba;
    width: 0%;
    transition: width 0.3s ease;
}

.vtp-progress-info {
    display: flex;
    justify-content: space-between;
    color: #555;
    font-size: 14px;
    position: absolute;
    width: 100%;
    top: 25px; /* Position below the progress bar */
    left: 0;
    right: 0;
    transition: opacity 0.3s ease;
}

.vtp-time-remaining {
    position: absolute;
    color: #555;
    font-size: 14px;
    text-align: right;
    top: 50px; /* Position below the progress info */
    right: 0;
    transition: opacity 0.3s ease;
}

/* SSH output styles */
.vtp-ssh-output-container {
    margin: 30px 0;
}

.vtp-ssh-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.vtp-ssh-output {
    background-color: #ffffff;
    color: #000000;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Loading animation for better visual feedback */
.translation-status {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4caf50;
    margin-right: 12px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

/* Video player styles */
.vtp-players-container {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

/* Default video player styling for all layouts */
.vtp-player-wrapper {
    width: 48%;
    min-width: 300px;
    max-width: 610px;
    margin-bottom: 20px;
}

.vtp-video-player {
    width: 100%;
}

.vtp-video-player video {
    width: 100%;
    display: block;
}

/* Video container layouts based on aspect ratio */

/* 16:9 layout (landscape) - equal sized players side by side */
.vtp-layout-16-9 .vtp-players-container {
    display: flex;
    justify-content: center; /* Center both players */
    align-items: center;    /* Align vertically */
    gap: 20px;              /* Space between players */
    margin: 0 auto;
}

.vtp-layout-16-9 .vtp-player-wrapper {
    flex: 0 0 48%;           /* Each player takes 48% width */
    max-width: 610px;        /* Maximum width as before */
}

.vtp-layout-16-9 .vtp-video-player video {
    aspect-ratio: 16/9;      /* Maintain 16:9 aspect ratio */
}

/* Standard landscape layout for other aspect ratios */
.vtp-layout-landscape .vtp-players-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.vtp-layout-landscape .vtp-player-wrapper {
    flex: 0 0 48%;           /* Equal width, capped at 48% */
}

/* Portrait layout (vertical/mobile videos) */
.vtp-layout-9-16 .vtp-players-container,
.vtp-layout-portrait .vtp-players-container {
    display: flex;
    flex-direction: row;      /* Always side by side */
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin: 0 auto;
}

.vtp-layout-9-16 .vtp-player-wrapper,
.vtp-layout-portrait .vtp-player-wrapper {
    flex: 0 0 45%;           /* Slightly narrower for portrait */
    max-width: 400px;
}

.vtp-layout-9-16 .vtp-video-player video,
.vtp-layout-portrait .vtp-video-player video {
    aspect-ratio: 9/16;      /* Maintain 9:16 aspect ratio for portrait videos */
}

/* Legacy styling - keeping for compatibility */
.vtp-layout-9-16 .vtp-player-wrapper {
    width: auto;
    margin: 0;
}

.vtp-layout-9-16 .vtp-video-player video {
    height: 738px;
    aspect-ratio: 9/16; /* This computes to width ≈ 415px */
}

/* Responsive adjustments */
@media (max-width: 1240px) {
    /* 16:9 layout responsive adjustments for smaller screens */
    .vtp-layout-16-9 .vtp-players-container {
        width: 100%;
        height: auto;
        flex-direction: column;
    }
    
    .vtp-layout-16-9 .vtp-player-wrapper {
        width: 100%;
        max-width: 610px;
        margin: 0 auto 30px;
    }
    
    .vtp-layout-16-9 .vtp-video-player video {
        width: 100%;
        height: auto;
        max-width: 610px;
    }
    
    /* 9:16 layout responsive adjustments for smaller screens */
    .vtp-layout-9-16 .vtp-players-container {
        height: auto;
        flex-direction: column;
        gap: 30px;
    }
    
    .vtp-layout-9-16 .vtp-player-wrapper {
        margin: 0 auto;
    }
    
    .vtp-layout-9-16 .vtp-video-player video {
        height: auto;
        max-height: 80vh;
        width: auto;
        max-width: 100%;
        aspect-ratio: 9/16;
    }
}

@media (max-width: 768px) {
    .vtp-layout-landscape .vtp-player-wrapper,
    .vtp-layout-portrait .vtp-player-wrapper {
        width: 100%;
        display: block;
        margin-bottom: 30px;
    }
    
    .vtp-layout-landscape .vtp-players-container {
        display: block;
    }
}

.vtp-player-wrapper {
    margin-bottom: 30px;
}

.vtp-player-wrapper h3 {
    margin-bottom: 15px;
    color: #333;
}

.vtp-video-player {
    width: 100%;
    margin-bottom: 15px;
}

.vtp-video-player video {
    width: 100%;
    height: auto;
    background-color: #000;
}

.vtp-player-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

/* Modal styles */
.vtp-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.vtp-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 100px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    z-index: 1002;
    position: relative;
    top: 300px;
}

.vtp-modal-body {
    margin-bottom: 20px;
}

.vtp-modal-body p {
    margin: 0;
    color: #333;
}

.vtp-modal-footer {
    text-align: center;
}

.vtp-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}
