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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.language-selector select {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.language-selector select:hover {
    border-color: #764ba2;
}

main {
    padding: 40px 0;
}

.tool-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 20px;
    border: none;
    background: #f0f0f0;
    color: #666;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.drop-zone {
    background: white;
    border: 3px dashed #667eea;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    margin-bottom: 30px;
}

.drop-zone.dragover {
    border-color: #764ba2;
    background: #f8f9ff;
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: #667eea;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.drop-text {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.drop-subtext {
    color: #999;
    font-size: 14px;
}

.file-button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.file-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.files-list {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.files-list h3 {
    margin-bottom: 15px;
    color: #333;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.file-item:hover {
    background: #e8eaff;
    transform: translateX(5px);
}

.file-item button {
    width: 30px;
    height: 30px;
    border: none;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.file-item button:hover {
    background: #cc0000;
    transform: rotate(90deg);
}

.tool-panel {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.tool-panel h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 24px;
}

.tool-panel p {
    color: #666;
    margin-bottom: 20px;
}

.action-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

.split-options,
.watermark-options,
.protect-options,
.compress-options,
.convert-options {
    margin-bottom: 20px;
}

.split-options label,
.protect-options label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.split-options input[type="radio"],
.protect-options input[type="checkbox"] {
    margin-right: 10px;
}

#rangeInput {
    margin-top: 10px;
}

#pageRange {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.rotate-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.rotate-btn {
    flex: 1;
    padding: 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.rotate-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.rotate-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.watermark-options input,
.protect-options input[type="password"],
.convert-options input,
.compress-options select,
.convert-options select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.watermark-options input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.preview-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.preview-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.preview-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.preview-controls button {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.preview-controls button:hover {
    background: #667eea;
    color: white;
}

#pageInfo {
    font-weight: 600;
    color: #333;
}

#previewCanvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
}

footer {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px 0;
    margin-top: 50px;
}

footer p {
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    header h1 {
        font-size: 22px;
    }
    
    .tool-tabs {
        gap: 5px;
        padding: 10px;
    }
    
    .tab-btn {
        font-size: 12px;
        padding: 10px 15px;
        min-width: 80px;
    }
    
    .drop-zone {
        padding: 40px 15px;
    }
    
    .upload-icon {
        width: 60px;
        height: 60px;
    }
    
    .drop-text {
        font-size: 16px;
    }
    
    .tool-panel {
        padding: 20px;
    }
    
    .rotate-options {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        padding: 12px 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .tool-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
}