* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    background: #161616;
    border-radius: 16px;
    border: 1px solid #2a2a2a;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    padding: 40px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo img {
    height: 40px;
    width: auto;
}

h1 {
    text-align: center;
    color: #f5f5f5;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 0;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    color: #888;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #b0b0b0;
    background: transparent;
}

.tab-button.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

.tab-button:active {
    transform: none;
}

.tab-content {
    min-height: 300px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

h2 {
    color: #f5f5f5;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #b0b0b0;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
select {
    width: 100%;
    padding: 12px 16px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    font-size: 14px;
    color: #e0e0e0;
    transition: border-color 0.2s, background 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #404040;
    background: #1a1a1a;
}

input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 12px;
}

input[type="file"]::file-selector-button:hover {
    background: #3a3a3a;
}

button {
    width: 100%;
    padding: 14px;
    background: #ffffff;
    color: #0a0a0a;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:hover {
    background: #f0f0f0;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: #2a2a2a;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    padding: 8px 16px;
    font-size: 14px;
}

.secondary-btn:hover {
    background: #222;
    border-color: #3a3a3a;
}

.experimental-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.experimental-btn:hover {
    background: linear-gradient(135deg, #7c8ff0 0%, #8b5ab8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.experimental-btn:active {
    transform: scale(0.98) translateY(0);
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.video-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.video-item:hover {
    border-color: #4a4a4a;
    background: #222;
}

.video-item.selected {
    border-color: #ffffff;
    background: #2a2a2a;
}

.video-item-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.video-item-meta {
    font-size: 12px;
    color: #888;
}

.open-video-btn {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px 10px;
    margin-left: 12px;
    flex-shrink: 0;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: auto;
    min-width: auto;
}

.open-video-btn:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #ffffff;
    transform: translateY(-1px);
}

.open-video-btn:active {
    transform: translateY(0);
}

.info-video-btn {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px 10px;
    margin-left: 12px;
    flex-shrink: 0;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: auto;
    min-width: auto;
}

.info-video-btn:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
    color: #ffffff;
    transform: translateY(-1px);
}

.info-video-btn:active {
    transform: translateY(0);
}

.videos-list {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.videos-list:empty {
    display: none;
}

/* Quick Action Section */
.quick-action-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #2a2a2a;
    text-align: center;
}

.quick-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.quick-btn:hover {
    background: linear-gradient(135deg, #7c8ff0 0%, #8b5ab8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.quick-btn:active {
    transform: scale(0.98) translateY(0);
}

.quick-action-section small {
    display: block;
    color: #888;
    font-size: 12px;
    margin-top: 8px;
}

.progress-section {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #2a2a2a;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: #ffffff;
    width: 0%;
    transition: width 0.3s;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

#progressText {
    text-align: center;
    color: #a0a0a0;
    font-size: 14px;
}

.result-section,
.error-section {
    margin-top: 30px;
}

.result-content {
    background: #0f0f0f;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    margin-bottom: 20px;
}

.result-item {
    margin-bottom: 15px;
}

.result-item strong {
    display: block;
    color: #a0a0a0;
    margin-bottom: 5px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-item span,
.result-item a {
    color: #ffffff;
    word-break: break-all;
    font-size: 14px;
}

.result-item a {
    text-decoration: none;
    opacity: 0.8;
}

.result-item a:hover {
    opacity: 1;
}

.thumbnail-preview {
    margin: 20px 0;
}

.thumbnail-preview img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

pre {
    background: #0f0f0f;
    color: #b0b0b0;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
}

.error-section {
    text-align: center;
}

.error-section h2 {
    color: #ff6b6b;
}

#errorMessage {
    color: #b0b0b0;
    margin-bottom: 20px;
    padding: 15px;
    background: #1a0a0a;
    border-radius: 8px;
    border: 1px solid #3a1a1a;
}

.advanced-options {
    background: #0f0f0f;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
}

.advanced-options summary {
    cursor: pointer;
    font-weight: 600;
    color: #ffffff;
    padding: 5px 0;
    user-select: none;
    font-size: 14px;
}

.advanced-options summary:hover {
    opacity: 0.8;
}

.advanced-options[open] summary {
    margin-bottom: 15px;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
    color: #ffffff;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #ffffff;
}

.section-divider {
    height: 1px;
    background: #2a2a2a;
    margin: 25px 0 20px 0;
}

.advanced-options h3 {
    color: #f5f5f5;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.login-error {
    background: #1a0a0a;
    border: 1px solid #3a1a1a;
    color: #ff6b6b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

.info-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #444;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    font-size: 12px;
    width: auto;
    min-width: auto;
    margin-left: 8px;
    transition: all 0.2s;
}

.info-btn:hover {
    background: #2a2a2a;
    border-color: #666;
    color: #fff;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #161616;
    border-radius: 16px;
    border: 1px solid #2a2a2a;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: auto;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h3 {
    color: #f5f5f5;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-section p {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.6;
    margin: 4px 0;
}

.modal-section p strong {
    color: #888;
    font-weight: 500;
    display: inline-block;
    min-width: 140px;
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 5px;
    border: 2px solid #0f0f0f;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a #0f0f0f;
}

@media (max-width: 640px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 24px;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
}