:root {
    --primary-color: #0066ff;
    --primary-hover: #0052cc;
    --danger-color: #ff4444;
    --danger-hover: #cc0000;
    --secondary-color: #6c757d;
    --secondary-hover: #545b62;
    --background: #ffffff;
    --surface: #f8f9fa;
    --border: #dee2e6;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 3px 6px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    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: var(--text-primary);
    line-height: 1.6;
}

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

.header {
    text-align: center;
    padding: 40px 20px;
    background: var(--background);
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

.language-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.language-selector select:hover {
    border-color: var(--primary-color);
}

.main-content {
    background: var(--background);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.group-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.group-selector select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
}

.group-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.group-name-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.group-name-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
}

.hidden {
    display: none !important;
}

.url-input-container {
    position: relative;
}

#urlTextarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: var(--transition);
}

#urlTextarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.url-stats {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-weight: 500;
    color: var(--text-primary);
}

.setting-item input[type="number"] {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
}

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-large {
    padding: 16px 40px;
    font-size: 18px;
}

.secondary-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.url-preview {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.url-item {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: var(--background);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    transition: var(--transition);
}

.url-item:hover {
    background: #e9ecef;
}

.url-item.invalid {
    background: #fff5f5;
    border-left: 3px solid var(--danger-color);
    color: var(--danger-color);
}

.url-item.more {
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    background: transparent;
}

.footer {
    text-align: center;
    padding: 30px 20px;
    color: white;
    margin-top: 40px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 30px 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .language-selector {
        position: static;
        margin-top: 20px;
    }
    
    .group-selector {
        flex-direction: column;
    }
    
    .secondary-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease-out;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}