/**
 * 画像リサイズツール v1.0.0 - Stylesheet
 * Copyright (c) 2024 tikisan (tikipiya)
 * GitHub: https://github.com/tikipiya
 */

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

body {
    font-family: Arial, sans-serif;
    background: #f0f0f0;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    background: #ddd;
    padding: 20px;
    border: 1px solid #ccc;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

header p {
    font-size: 1rem;
    color: #666;
}

/* Upload Section */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #999;
    padding: 40px 20px;
    text-align: center;
    background: white;
    cursor: pointer;
    border-radius: 5px;
}

.upload-area:hover {
    background: #f9f9f9;
    border-color: #777;
}

.upload-area.dragover {
    background: #e9f5e9;
    border-color: #4CAF50;
}

.upload-content {
    color: #333;
}

.upload-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    fill: #999;
}

.upload-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.upload-content p {
    margin-bottom: 20px;
    color: #666;
}

.select-btn {
    background: #007cba;
    color: white;
    border: 1px solid #005a87;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
}

.select-btn:hover {
    background: #005a87;
}

/* Main Content */
.main-content {
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
}

.preview-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.image-container {
    text-align: center;
}

.image-container h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1rem;
}

#originalImage, #resizedCanvas {
    max-width: 100%;
    max-height: 300px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

.image-info {
    font-size: 0.9rem;
    color: #666;
    background: #f0f0f0;
    padding: 5px 10px;
    border: 1px solid #ddd;
    display: inline-block;
}

/* Controls Section */
.controls-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    margin-bottom: 5px;
    font-weight: normal;
    color: #555;
}

.control-group input[type="number"], .control-group select {
    padding: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.control-group input[type="number"]:focus, .control-group select:focus {
    outline: none;
    border-color: #007cba;
}

.control-group input[type="range"] {
    margin-bottom: 5px;
}

#qualityValue {
    font-weight: bold;
    color: #007cba;
}

.checkbox-group {
    justify-content: center;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn, .tertiary-btn {
    padding: 10px 20px;
    border: 1px solid;
    cursor: pointer;
    font-size: 1rem;
    min-width: 120px;
}

.primary-btn {
    background: #007cba;
    color: white;
    border-color: #005a87;
}

.primary-btn:hover:not(:disabled) {
    background: #005a87;
}

.secondary-btn {
    background: #4CAF50;
    color: white;
    border-color: #45a049;
}

.secondary-btn:hover:not(:disabled) {
    background: #45a049;
}

.tertiary-btn {
    background: #f44336;
    color: white;
    border-color: #da190b;
}

.tertiary-btn:hover:not(:disabled) {
    background: #da190b;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Range Slider Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    height: 4px;
    background: #ccc;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: 1px solid #005a87;
}

input[type="range"]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: 1px solid #005a87;
}

/* Footer Styles */
footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #ddd;
    background: #f5f5f5;
}

.copyright {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.copyright p {
    margin: 5px 0;
}

.copyright a {
    color: #007cba;
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}

.copyright .message {
    margin-top: 10px;
    font-style: italic;
    color: #555;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .preview-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-btn, .secondary-btn, .tertiary-btn {
        width: 100%;
        max-width: 250px;
    }
    
    footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .copyright {
        font-size: 0.8rem;
    }
    
    .copyright .message {
        font-size: 0.75rem;
    }
}
