* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.page-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.banner-ad {
    flex: 0 0 260px;
    height: fit-content;
}

.banner-ad-left {
    display: none;
}

.banner-ad-right {
    display: none;
}

.ad-placeholder {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
    text-align: center;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-weight: 500;
}

/* Show ads on desktop */
@media (min-width: 1400px) {
    .banner-ad-left,
    .banner-ad-right {
        display: block;
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    transition: opacity 0.3s ease;
}

header:hover {
    opacity: 0.9;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    font-size: 1.1em;
    opacity: 0.95;
}

.main-content {
    padding: 40px 30px;
}

section {
    margin-bottom: 40px;
}

section h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

/* Upload Section */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area:hover {
    background: #f0f2ff;
    border-color: #764ba2;
}

.upload-area.dragover {
    background: #e8ebff;
    border-color: #764ba2;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.upload-area p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-upload {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 35px;
    font-size: 1.1em;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 35px;
    font-size: 1.1em;
    margin-top: 20px;
    width: 100%;
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-download {
    background: linear-gradient(135deg, #06c755 0%, #05aa36 100%);
    color: white;
    padding: 15px 35px;
    font-size: 1.1em;
    width: 100%;
    margin-top: 20px;
}

.btn-download:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(6, 199, 85, 0.4);
}

.btn-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 35px;
    font-size: 1.1em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e7ff;
    color: #667eea;
    padding: 10px 20px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-secondary:hover {
    background: #d0d8ff;
    transform: translateY(-2px);
}

.btn-time-set {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-time-set:hover {
    background: #764ba2;
}

/* Video Section */
.video-section {
    animation: fadeIn 0.3s ease;
}

.video-preview-container {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#videoPreview {
    width: 100%;
    height: auto;
    display: block;
}

.video-info {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
}

.info-item {
    flex: 1;
}

.info-item label {
    display: block;
    color: #666;
    font-weight: 600;
    margin-bottom: 5px;
}

.info-item span {
    display: block;
    color: #333;
    font-size: 1.3em;
    font-weight: 700;
}

/* Timestamp Controls */
.timestamp-controls {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.time-input-group {
    margin-bottom: 20px;
}

.time-input-group:last-child {
    margin-bottom: 0;
}

.time-input-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.time-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 8px;
    transition: border-color 0.3s ease;
}

.time-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

/* Screenshots Grid */
.screenshots-section {
    animation: fadeIn 0.3s ease;
}

.screenshots-toolbar {
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.selected-count {
    color: #667eea;
    font-weight: 600;
    font-size: 1.05em;
    margin-left: 10px;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.screenshot-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.screenshot-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.screenshot-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.screenshot-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
}

.screenshot-item input[type="checkbox"]:checked + .screenshot-overlay {
    background: rgba(102, 126, 234, 0.7);
}

.screenshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screenshot-item:hover .screenshot-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.screenshot-time {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.download-section {
    display: flex;
    gap: 15px;
}

/* Status Messages */
.status-message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Remove/Reupload Section */
.remove-upload-section {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 10px;
    border: 2px solid #28a745;
}

.remove-upload-section h2 {
    color: #155724;
    margin-bottom: 20px;
}

.video-uploaded-info {
    text-align: center;
}

.video-uploaded-info p {
    color: #155724;
    font-size: 1.1em;
    margin-bottom: 20px;
    font-weight: 500;
}

.uploaded-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* New Upload Section */
.new-upload-section {
    text-align: center;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
}

/* Footer */
footer {
    background: #f8f9fa;
    color: #666;
    text-align: center;
    padding: 30px 20px 20px 20px;
    border-top: 1px solid #e9ecef;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

/* Responsive */
@media (max-width: 1199px) {
    .page-wrapper {
        flex-direction: column;
        max-width: 100%;
    }

    .banner-ad-left,
    .banner-ad-right {
        display: none !important;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .main-content {
        padding: 20px 15px;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .screenshots-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.95em;
    }

    .timestamp-controls {
        padding: 15px;
    }

    .info-item {
        flex: 1;
    }

    .screenshots-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .download-section {
        flex-direction: column;
    }

    .btn-generate,
    .btn-download {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        padding: 25px 15px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .container {
        border-radius: 0;
    }

    .screenshots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .time-input-group {
        margin-bottom: 15px;
    }

    .btn-time-set {
        width: 100%;
        margin-top: 5px;
    }
}
