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

body {
    font-family: 'Noto Sans JP', Arial, sans-serif;
    background-color: #f0f0f0;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 300;
}

main {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.canvas-container {
    flex-shrink: 0;
}

.video-player {
    max-width: 100%;
    display: none;
}

canvas {
    border: 3px solid #34495e;
    border-radius: 10px;
    background-color: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: block;
    width: 360px;
    height: 360px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
}

.controls {
    flex: 1;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 300px;
}

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

.control-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.control-row .control-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

input[type="text"],
input[type="color"],
input[type="range"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3498db;
}

textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

input[type="color"] {
    height: 45px;
    padding: 5px;
    cursor: pointer;
}

input[type="range"] {
    margin-right: 10px;
}

span {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #e74c3c;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #229954;
}

.status {
    margin-top: 20px;
    padding: 15px;
    background-color: #ecf0f1;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#status-text {
    font-weight: 600;
    color: #2c3e50;
}

#timer {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e74c3c;
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    .canvas-container {
        text-align: center;
        margin-bottom: 20px;
    }
    
    canvas {
        max-width: 400px;
    }
    
    .controls {
        min-width: unset;
        width: 100%;
    }
    
    .control-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-group {
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .controls {
        padding: 15px;
        min-width: unset;
        width: 100%;
    }
    
    canvas {
    }
    
    .control-group {
        margin-bottom: 15px;
    }
    
    label {
        font-size: 0.85rem;
    }
    
    input, select, textarea {
        padding: 8px;
        font-size: 13px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .log-container {
        max-height: 150px;
        font-size: 0.7rem;
        padding: 10px;
    }
    
    .progress-section {
        padding: 10px;
    }
    
    .status {
        padding: 10px;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

/* Progress Bar Styles */
.progress-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background-color: #28a745;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #495057;
    text-align: center;
    font-weight: 600;
}

/* Log Display Styles */
.log-section {
    margin-top: 20px;
}

.log-section h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.log-container {
    max-height: 200px;
    overflow-y: auto;
    background-color: #2c3e50;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

.log-entry {
    margin-bottom: 8px;
    display: block;
}

.log-timestamp {
    color: #7f8c8d;
    margin-right: 10px;
    font-weight: 600;
}

.log-message {
    color: #ecf0f1;
}

.log-system .log-message {
    color: #3498db;
}

.log-ffmpeg .log-message {
    color: #e74c3c;
}

.log-info .log-message {
    color: #2ecc71;
}

/* Custom scrollbar for log container */
.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #34495e;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Footer Styles */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

footer a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #666;
}
